1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-05-22 10:21:03 +02:00

10th stage of arabic translation (#2319)

This commit is contained in:
Younies Mahmoud 2024-08-26 13:23:59 +02:00 committed by GitHub
parent 6ac0265c47
commit dde29b4ce3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

258
po/ar.po
View File

@ -4319,25 +4319,27 @@ msgstr ""
#: src/references/slices.md #: src/references/slices.md
msgid "Slices" msgid "Slices"
msgstr "" msgstr "الشرائح (Slices)"
#: src/references/slices.md #: src/references/slices.md
msgid "A slice gives you a view into a larger collection:" msgid "A slice gives you a view into a larger collection:"
msgstr "" msgstr "تعطيك الشريحة (slice) نظرة على مجموعة أكبر:"
#: src/references/slices.md #: src/references/slices.md
msgid "Slices borrow data from the sliced type." msgid "Slices borrow data from the sliced type."
msgstr "" msgstr "تستعير الشرائح (Slices) البيانات من النوع المقطوع (sliced type)."
#: src/references/slices.md #: src/references/slices.md
msgid "Question: What happens if you modify `a[3]` right before printing `s`?" msgid "Question: What happens if you modify `a[3]` right before printing `s`?"
msgstr "" msgstr "سؤال: ماذا يحدث إذا قمت بتعديل `a[3]` قبل طباعة `s` مباشرةً؟"
#: src/references/slices.md #: src/references/slices.md
msgid "" msgid ""
"We create a slice by borrowing `a` and specifying the starting and ending " "We create a slice by borrowing `a` and specifying the starting and ending "
"indexes in brackets." "indexes in brackets."
msgstr "" msgstr ""
"نقوم بإنشاء شريحة (slice) عن طريق استعارة `a` وتحديد الفهارس (indexes) "
"البداية والنهاية بين الأقواس."
#: src/references/slices.md #: src/references/slices.md
msgid "" msgid ""
@ -4345,17 +4347,23 @@ msgid ""
"starting index, meaning that `&a[0..a.len()]` and `&a[..a.len()]` are " "starting index, meaning that `&a[0..a.len()]` and `&a[..a.len()]` are "
"identical." "identical."
msgstr "" msgstr ""
"إذا بدأت الشريحة (slice) عند الفهرس 0، فإن صيغة النطاق (range syntax) في "
"Rust تسمح لنا بإسقاط فهرس البداية، مما يعني أن `&a[0..a.len()]` و `&a[..a."
"len()]` متطابقتان."
#: src/references/slices.md #: src/references/slices.md
msgid "" msgid ""
"The same is true for the last index, so `&a[2..a.len()]` and `&a[2..]` are " "The same is true for the last index, so `&a[2..a.len()]` and `&a[2..]` are "
"identical." "identical."
msgstr "" msgstr ""
"ينطبق نفس الشيء على الفهرس الأخير، لذا فإن `&a[2..a.len()]` و `&a[2..]` "
"متطابقتان."
#: src/references/slices.md #: src/references/slices.md
msgid "" msgid ""
"To easily create a slice of the full array, we can therefore use `&a[..]`." "To easily create a slice of the full array, we can therefore use `&a[..]`."
msgstr "" msgstr ""
"لإنشاء شريحة (slice) بسهولة من المصفوفة الكاملة، يمكننا استخدام `&a[..]`."
#: src/references/slices.md #: src/references/slices.md
msgid "" msgid ""
@ -4363,12 +4371,17 @@ msgid ""
"(`&[i32]`) no longer mentions the array length. This allows us to perform " "(`&[i32]`) no longer mentions the array length. This allows us to perform "
"computation on slices of different sizes." "computation on slices of different sizes."
msgstr "" msgstr ""
"`s` هو مرجع لشريحة (slice) من `i32`s. لاحظ أن نوع `s` (`&[i32]`) لم يعد يذكر "
"طول المصفوفة. هذا يسمح لنا بإجراء العمليات الحسابية على شرائح (slices) "
"بأحجام مختلفة."
#: src/references/slices.md #: src/references/slices.md
msgid "" msgid ""
"Slices always borrow from another object. In this example, `a` has to remain " "Slices always borrow from another object. In this example, `a` has to remain "
"'alive' (in scope) for at least as long as our slice." "'alive' (in scope) for at least as long as our slice."
msgstr "" msgstr ""
"الشرائح (Slices) تستعير دائمًا من كائن آخر. في هذا المثال، يجب أن يبقى `a` "
"موجودًا (في النطاق) على الأقل طالما أن شريحتنا (slice) موجودة."
#: src/references/slices.md #: src/references/slices.md
msgid "" msgid ""
@ -4378,40 +4391,47 @@ msgid ""
"safely. It works before you created the slice, and again after the " "safely. It works before you created the slice, and again after the "
"`println`, when the slice is no longer used." "`println`, when the slice is no longer used."
msgstr "" msgstr ""
"السؤال حول تعديل `a[3]` يمكن أن يثير نقاشًا مثيرًا للاهتمام، ولكن الإجابة هي "
"أنه لأسباب تتعلق بسلامة الذاكرة (memory safety) لا يمكنك القيام بذلك من خلال "
"`a` في هذه المرحلة من التنفيذ (execution)، ولكن يمكنك قراءة البيانات من كل "
"من `a` و `s` بأمان. يعمل ذلك قبل إنشاء الشريحة (slice)، ومرة أخرى بعد "
"`println`، عندما لا يتم استخدام الشريحة (slice) بعد الآن."
#: src/references/strings.md #: src/references/strings.md
msgid "We can now understand the two string types in Rust:" msgid "We can now understand the two string types in Rust:"
msgstr "" msgstr "يمكننا الآن فهم نوعي السلاسل النصية (string types) في Rust:"
#: src/references/strings.md #: src/references/strings.md
msgid "`&str` is a slice of UTF-8 encoded bytes, similar to `&[u8]`." msgid "`&str` is a slice of UTF-8 encoded bytes, similar to `&[u8]`."
msgstr "" msgstr "`&str` هو شريحة (slice) من بايتات مشفرة بـ UTF-8، مشابهة لـ `&[u8]`."
#: src/references/strings.md #: src/references/strings.md
msgid "" msgid ""
"`String` is an owned buffer of UTF-8 encoded bytes, similar to `Vec<T>`." "`String` is an owned buffer of UTF-8 encoded bytes, similar to `Vec<T>`."
msgstr "" msgstr ""
"`String` هو مخزن مؤقت مملوك (owned buffer) من بايتات مشفرة بـ UTF-8، مشابه "
"لـ `Vec<T>`."
#: src/references/strings.md src/std-traits/read-and-write.md #: src/references/strings.md src/std-traits/read-and-write.md
msgid "\"World\"" msgid "\"World\""
msgstr "" msgstr "\"World\""
#: src/references/strings.md #: src/references/strings.md
msgid "\"s1: {s1}\"" msgid "\"s1: {s1}\""
msgstr "" msgstr "\"s1: {s1}\""
#: src/references/strings.md #: src/references/strings.md
#, fuzzy #, fuzzy
msgid "\"Hello \"" msgid "\"Hello \""
msgstr "مرحبًا، أيها العالم" msgstr "\"مرحبًا، أيها العالم\""
#: src/references/strings.md src/memory-management/move.md #: src/references/strings.md src/memory-management/move.md
msgid "\"s2: {s2}\"" msgid "\"s2: {s2}\""
msgstr "" msgstr "\"s2: {s2}\""
#: src/references/strings.md #: src/references/strings.md
msgid "\"s3: {s3}\"" msgid "\"s3: {s3}\""
msgstr "" msgstr "\"s3: {s3}\""
#: src/references/strings.md #: src/references/strings.md
msgid "" msgid ""
@ -4419,12 +4439,17 @@ msgid ""
"encoded string data stored in a block of memory. String literals " "encoded string data stored in a block of memory. String literals "
"(`\"Hello\"`), are stored in the program’s binary." "(`\"Hello\"`), are stored in the program’s binary."
msgstr "" msgstr ""
"`&str` يقدم شريحة نصية (string slice)، وهي مرجع غير قابل للتغيير (immutable "
"reference) لبيانات نصية مشفرة بـ UTF-8 مخزنة في كتلة من الذاكرة. الحروف "
"النصية (`\"Hello\"`)، مخزنة في البرنامج الثنائي (binary)."
#: src/references/strings.md #: src/references/strings.md
msgid "" msgid ""
"Rust's `String` type is a wrapper around a vector of bytes. As with a " "Rust's `String` type is a wrapper around a vector of bytes. As with a "
"`Vec<T>`, it is owned." "`Vec<T>`, it is owned."
msgstr "" msgstr ""
"نوع `String` في Rust هو غلاف حول متجه من البايتات (vector of bytes). كما هو "
"الحال مع `Vec<T>`، فهو مملوك (owned)."
#: src/references/strings.md #: src/references/strings.md
msgid "" msgid ""
@ -4432,12 +4457,18 @@ msgid ""
"literal; `String::new()` creates a new empty string, to which string data " "literal; `String::new()` creates a new empty string, to which string data "
"can be added using the `push()` and `push_str()` methods." "can be added using the `push()` and `push_str()` methods."
msgstr "" msgstr ""
"كما هو الحال مع العديد من الأنواع الأخرى، فإن `String::from()` ينشئ سلسلة "
"نصية من حرف نصي (string literal)؛ `String::new()` ينشئ سلسلة نصية جديدة "
"فارغة، يمكن إضافة بيانات نصية إليها باستخدام طريقتي `push()` و `push_str()`."
#: src/references/strings.md #: src/references/strings.md
msgid "" msgid ""
"The `format!()` macro is a convenient way to generate an owned string from " "The `format!()` macro is a convenient way to generate an owned string from "
"dynamic values. It accepts the same format specification as `println!()`." "dynamic values. It accepts the same format specification as `println!()`."
msgstr "" msgstr ""
"الماكرو `format!()` هو طريقة مريحة لإنشاء سلسلة نصية مملوكة (owned string) "
"من قيم ديناميكية. يقبل نفس مواصفات التنسيق (format specification) مثل "
"`println!()`."
#: src/references/strings.md #: src/references/strings.md
msgid "" msgid ""
@ -4446,6 +4477,10 @@ msgid ""
"boundaries, the expression will panic. The `chars` iterator iterates over " "boundaries, the expression will panic. The `chars` iterator iterates over "
"characters and is preferred over trying to get character boundaries right." "characters and is preferred over trying to get character boundaries right."
msgstr "" msgstr ""
"يمكنك استعارة شرائح `&str` من `String` عبر `&` واختيار النطاق (range "
"selection) اختياريًا. إذا اخترت نطاق بايت غير متوافق مع حدود الأحرف، فإن "
"التعبير سيتسبب في خطأ (panic). المكرر `chars` يتكرر عبر الأحرف ويفضل "
"استخدامه على محاولة الحصول على حدود الأحرف بشكل صحيح."
#: src/references/strings.md #: src/references/strings.md
msgid "" msgid ""
@ -4454,10 +4489,16 @@ msgid ""
"equivalent of `std::string` from C++ (main difference: it can only contain " "equivalent of `std::string` from C++ (main difference: it can only contain "
"UTF-8 encoded bytes and will never use a small-string optimization)." "UTF-8 encoded bytes and will never use a small-string optimization)."
msgstr "" msgstr ""
"لمبرمجي C++: فكر في `&str` كـ `std::string_view` من C++، ولكنه دائمًا يشير "
"إلى سلسلة نصية صالحة في الذاكرة. `String` في Rust هو مكافئ تقريبي لـ `std::"
"string` من C++ (الفرق الرئيسي: يمكن أن يحتوي فقط على بايتات مشفرة بـ UTF-8 "
"ولن يستخدم أبدًا تحسين السلسلة الصغيرة (small-string optimization))."
#: src/references/strings.md #: src/references/strings.md
msgid "Byte strings literals allow you to create a `&[u8]` value directly:" msgid "Byte strings literals allow you to create a `&[u8]` value directly:"
msgstr "" msgstr ""
"الحروف النصية للبايت (Byte strings literals) تتيح لك إنشاء قيمة `&[u8]` "
"مباشرةً:"
#: src/references/strings.md #: src/references/strings.md
msgid "" msgid ""
@ -4465,13 +4506,9 @@ msgid ""
"`r\"\\n\" == \"\\\\n\"`. You can embed double-quotes by using an equal " "`r\"\\n\" == \"\\\\n\"`. You can embed double-quotes by using an equal "
"amount of `#` on either side of the quotes:" "amount of `#` on either side of the quotes:"
msgstr "" msgstr ""
"السلاسل النصية الخام (Raw strings) تتيح لك إنشاء قيمة `&str` مع تعطيل الهروب "
#: src/references/exercise.md "(escapes): `r\"\\n\" == \"\\\\n\"`. يمكنك تضمين علامات الاقتباس المزدوجة "
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
msgid "" msgid ""
@ -4481,111 +4518,126 @@ msgid ""
"square\n" "square\n"
"// root, like `v.sqrt()`.\n" "// root, like `v.sqrt()`.\n"
msgstr "" msgstr ""
"// احسب مقدار المتجه (magnitude of a vector) بجمع مربعات إحداثياته\n"
"// وأخذ الجذر التربيعي (square root). استخدم طريقة `sqrt()` لحساب الجذر\n"
"// التربيعي، مثل `v.sqrt()`.\n"
#: src/references/exercise.md #: src/references/exercise.md
msgid "" msgid ""
"// Normalize a vector by calculating its magnitude and dividing all of its\n" "// Normalize a vector by calculating its magnitude and dividing all of its\n"
"// coordinates by that magnitude.\n" "// coordinates by that magnitude.\n"
msgstr "" msgstr ""
"// قم بتطبيع المتجه (Normalize a vector) بحساب مقداره (magnitude) وقسمة جميع "
"إحداثياته\n"
"// على هذا المقدار (magnitude).\n"
#: src/references/exercise.md #: src/references/exercise.md
msgid "// Use the following `main` to test your work.\n" msgid "// Use the following `main` to test your work.\n"
msgstr "" msgstr "// استخدم `main` التالي لاختبار عملك.\n"
#: src/references/exercise.md src/references/solution.md #: src/references/exercise.md src/references/solution.md
msgid "\"Magnitude of a unit vector: {}\"" msgid "\"Magnitude of a unit vector: {}\""
msgstr "" msgstr "\"مقدار المتجه الواحد: {}\""
#: src/references/exercise.md src/references/solution.md #: src/references/exercise.md src/references/solution.md
msgid "\"Magnitude of {v:?}: {}\"" msgid "\"Magnitude of {v:?}: {}\""
msgstr "" msgstr "\"مقدار {v:?}: {}\""
#: src/references/exercise.md src/references/solution.md #: src/references/exercise.md src/references/solution.md
msgid "\"Magnitude of {v:?} after normalization: {}\"" msgid "\"Magnitude of {v:?} after normalization: {}\""
msgstr "" msgstr "\"مقدار {v:?} بعد التطبيع: {}\""
#: src/references/solution.md #: src/references/solution.md
msgid "/// Calculate the magnitude of the given vector.\n" msgid "/// Calculate the magnitude of the given vector.\n"
msgstr "" msgstr "/// احسب مقدار المتجه (magnitude of the vector) المعطى.\n"
#: src/references/solution.md #: src/references/solution.md
msgid "" msgid ""
"/// Change the magnitude of the vector to 1.0 without changing its " "/// Change the magnitude of the vector to 1.0 without changing its "
"direction.\n" "direction.\n"
msgstr "" msgstr "/// غير مقدار المتجه إلى 1.0 دون تغيير اتجاهه.\n"
#: src/user-defined-types.md #: src/user-defined-types.md
msgid "[Named Structs](./user-defined-types/named-structs.md) (10 minutes)" msgid "[Named Structs](./user-defined-types/named-structs.md) (10 minutes)"
msgstr "" msgstr ""
"[الهياكل المسماة (Named Structs)](./user-defined-types/named-structs.md) (10 "
"دقائق)"
#: src/user-defined-types.md #: src/user-defined-types.md
msgid "[Tuple Structs](./user-defined-types/tuple-structs.md) (10 minutes)" msgid "[Tuple Structs](./user-defined-types/tuple-structs.md) (10 minutes)"
msgstr "" msgstr ""
"[هياكل الترتيب (Tuple Structs)](./user-defined-types/tuple-structs.md) (10 "
"دقائق)"
#: src/user-defined-types.md #: src/user-defined-types.md
msgid "[Enums](./user-defined-types/enums.md) (5 minutes)" msgid "[Enums](./user-defined-types/enums.md) (5 minutes)"
msgstr "" msgstr "[التعدادات (Enums)](./user-defined-types/enums.md) (5 دقائق)"
#: src/user-defined-types.md #: src/user-defined-types.md
msgid "[Static](./user-defined-types/static.md) (5 minutes)" msgid "[Static](./user-defined-types/static.md) (5 minutes)"
msgstr "" msgstr "[ثابت (Static)](./user-defined-types/static.md) (5 دقائق)"
#: src/user-defined-types.md #: src/user-defined-types.md
msgid "[Type Aliases](./user-defined-types/aliases.md) (2 minutes)" msgid "[Type Aliases](./user-defined-types/aliases.md) (2 minutes)"
msgstr "" msgstr ""
"[أسماء مستعارة للأنواع (Type Aliases)](./user-defined-types/aliases.md) "
"(دقيقتان)"
#: src/user-defined-types.md #: src/user-defined-types.md
msgid "" msgid ""
"[Exercise: Elevator Events](./user-defined-types/exercise.md) (15 minutes)" "[Exercise: Elevator Events](./user-defined-types/exercise.md) (15 minutes)"
msgstr "" msgstr ""
"[تمرين: أحداث المصعد (Elevator Events)](./user-defined-types/exercise.md) "
"(15 دقيقة)"
#: src/user-defined-types.md src/methods-and-traits.md src/lifetimes.md #: src/user-defined-types.md src/methods-and-traits.md src/lifetimes.md
msgid "This segment should take about 50 minutes" msgid "This segment should take about 50 minutes"
msgstr "" msgstr "يجب أن يستغرق هذا الجزء حوالي 50 دقيقة"
#: src/user-defined-types/named-structs.md #: src/user-defined-types/named-structs.md
msgid "Like C and C++, Rust has support for custom structs:" msgid "Like C and C++, Rust has support for custom structs:"
msgstr "" msgstr "مثل C و C++، يدعم Rust الهياكل المخصصة (custom structs):"
#: src/user-defined-types/named-structs.md #: src/user-defined-types/named-structs.md
msgid "\"{} is {} years old\"" msgid "\"{} is {} years old\""
msgstr "" msgstr "\"{} is {} years old\""
#: src/user-defined-types/named-structs.md #: src/user-defined-types/named-structs.md
#: src/android/interoperability/with-c/bindgen.md #: src/android/interoperability/with-c/bindgen.md
msgid "\"Peter\"" msgid "\"Peter\""
msgstr "" msgstr "\"بيتر\""
#: src/user-defined-types/named-structs.md #: src/user-defined-types/named-structs.md
msgid "\"Avery\"" msgid "\"Avery\""
msgstr "" msgstr "\"أفيري\""
#: src/user-defined-types/named-structs.md #: src/user-defined-types/named-structs.md
msgid "\"Jackie\"" msgid "\"Jackie\""
msgstr "" msgstr "\"جاكي\""
#: src/user-defined-types/named-structs.md src/user-defined-types/enums.md #: src/user-defined-types/named-structs.md src/user-defined-types/enums.md
#: src/pattern-matching/match.md src/methods-and-traits/methods.md #: src/pattern-matching/match.md src/methods-and-traits/methods.md
msgid "Key Points:" msgid "Key Points:"
msgstr "" msgstr "نقاط رئيسية (Key Points):"
#: src/user-defined-types/named-structs.md #: src/user-defined-types/named-structs.md
msgid "Structs work like in C or C++." msgid "Structs work like in C or C++."
msgstr "" msgstr "الهياكل (Structs) تعمل مثلما في C أو C++."
#: src/user-defined-types/named-structs.md #: src/user-defined-types/named-structs.md
msgid "Like in C++, and unlike in C, no typedef is needed to define a type." 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 #: src/user-defined-types/named-structs.md
msgid "Unlike in C++, there is no inheritance between structs." msgid "Unlike in C++, there is no inheritance between structs."
msgstr "" msgstr "على عكس C++، لا يوجد وراثة (inheritance) بين الهياكل (structs)."
#: src/user-defined-types/named-structs.md #: src/user-defined-types/named-structs.md
msgid "" msgid ""
"This may be a good time to let people know there are different types of " "This may be a good time to let people know there are different types of "
"structs." "structs."
msgstr "" msgstr ""
"قد يكون هذا وقتًا جيدًا لإعلام الناس بوجود أنواع مختلفة من الهياكل (structs)."
#: src/user-defined-types/named-structs.md #: src/user-defined-types/named-structs.md
msgid "" msgid ""
@ -4593,18 +4645,25 @@ msgid ""
"trait on some type but don’t have any data that you want to store in the " "trait on some type but don’t have any data that you want to store in the "
"value itself." "value itself."
msgstr "" msgstr ""
"الهياكل ذات الحجم الصفري (Zero-sized structs) (مثل `struct Foo;`) قد تُستخدم "
"عند تطبيق سمة (trait) على نوع معين ولكن لا تحتوي على أي بيانات تريد تخزينها "
"في القيمة نفسها."
#: src/user-defined-types/named-structs.md #: src/user-defined-types/named-structs.md
msgid "" msgid ""
"The next slide will introduce Tuple structs, used when the field names are " "The next slide will introduce Tuple structs, used when the field names are "
"not important." "not important."
msgstr "" msgstr ""
"الشريحة التالية ستقدم هياكل الترتيب (Tuple structs)، التي تُستخدم عندما لا "
"تكون أسماء الحقول مهمة."
#: src/user-defined-types/named-structs.md #: src/user-defined-types/named-structs.md
msgid "" msgid ""
"If you already have variables with the right names, then you can create the " "If you already have variables with the right names, then you can create the "
"struct using a shorthand." "struct using a shorthand."
msgstr "" msgstr ""
"إذا كان لديك بالفعل متغيرات بالأسماء الصحيحة، فيمكنك إنشاء الهيكل (struct) "
"باستخدام اختصار."
#: src/user-defined-types/named-structs.md #: src/user-defined-types/named-structs.md
msgid "" msgid ""
@ -4612,99 +4671,121 @@ msgid ""
"old struct without having to explicitly type it all out. It must always be " "old struct without having to explicitly type it all out. It must always be "
"the last element." "the last element."
msgstr "" msgstr ""
"الصيغة `..avery` تسمح لنا بنسخ معظم الحقول من الهيكل القديم دون الحاجة إلى "
"كتابتها جميعًا بشكل صريح. يجب أن تكون دائمًا العنصر الأخير."
#: src/user-defined-types/tuple-structs.md #: src/user-defined-types/tuple-structs.md
msgid "If the field names are unimportant, you can use a tuple struct:" msgid "If the field names are unimportant, you can use a tuple struct:"
msgstr "" msgstr ""
"إذا كانت أسماء الحقول غير مهمة، يمكنك استخدام هيكل الترتيب (tuple struct):"
#: src/user-defined-types/tuple-structs.md #: src/user-defined-types/tuple-structs.md
msgid "\"({}, {})\"" msgid "\"({}, {})\""
msgstr "" msgstr "\"({}, {})\""
#: src/user-defined-types/tuple-structs.md #: src/user-defined-types/tuple-structs.md
msgid "This is often used for single-field wrappers (called newtypes):" msgid "This is often used for single-field wrappers (called newtypes):"
msgstr "" msgstr ""
"غالبًا ما يُستخدم هذا للأغلفة ذات الحقل الواحد (single-field wrappers) (تسمى "
"newtypes):"
#: src/user-defined-types/tuple-structs.md #: src/user-defined-types/tuple-structs.md
msgid "\"Ask a rocket scientist at NASA\"" msgid "\"Ask a rocket scientist at NASA\""
msgstr "" msgstr "\"اسأل عالم صواريخ في ناسا\""
#: src/user-defined-types/tuple-structs.md #: src/user-defined-types/tuple-structs.md
#: src/android/interoperability/cpp/cpp-bridge.md #: src/android/interoperability/cpp/cpp-bridge.md
#: src/bare-metal/microcontrollers/type-state.md #: src/bare-metal/microcontrollers/type-state.md
#: src/concurrency/async-pitfalls/cancellation.md #: src/concurrency/async-pitfalls/cancellation.md
msgid "// ...\n" msgid "// ...\n"
msgstr "" msgstr "// ...\n"
#: src/user-defined-types/tuple-structs.md #: src/user-defined-types/tuple-structs.md
msgid "" msgid ""
"Newtypes are a great way to encode additional information about the value in " "Newtypes are a great way to encode additional information about the value in "
"a primitive type, for example:" "a primitive type, for example:"
msgstr "" msgstr ""
"الأنواع الجديدة (Newtypes) هي طريقة رائعة لترميز معلومات إضافية حول القيمة "
"في نوع بدائي (primitive type)، على سبيل المثال:"
#: src/user-defined-types/tuple-structs.md #: src/user-defined-types/tuple-structs.md
msgid "The number is measured in some units: `Newtons` in the example above." msgid "The number is measured in some units: `Newtons` in the example above."
msgstr "" msgstr "يتم قياس الرقم بوحدات معينة: `نيوتن` (Newtons) في المثال أعلاه."
#: src/user-defined-types/tuple-structs.md #: src/user-defined-types/tuple-structs.md
msgid "" msgid ""
"The value passed some validation when it was created, so you no longer have " "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)`." "to validate it again at every use: `PhoneNumber(String)` or `OddNumber(u32)`."
msgstr "" msgstr ""
"القيمة اجتازت بعض التحقق عند إنشائها، لذلك لم تعد بحاجة إلى التحقق منها مرة "
"أخرى في كل استخدام: `PhoneNumber(String)` أو `OddNumber(u32)`."
#: src/user-defined-types/tuple-structs.md #: src/user-defined-types/tuple-structs.md
msgid "" msgid ""
"Demonstrate how to add a `f64` value to a `Newtons` type by accessing the " "Demonstrate how to add a `f64` value to a `Newtons` type by accessing the "
"single field in the newtype." "single field in the newtype."
msgstr "" msgstr ""
"أظهر كيفية إضافة قيمة `f64` إلى نوع `Newtons` عن طريق الوصول إلى الحقل "
"الفردي في النوع الجديد (newtype)."
#: src/user-defined-types/tuple-structs.md #: src/user-defined-types/tuple-structs.md
msgid "" msgid ""
"Rust generally doesn’t like inexplicit things, like automatic unwrapping or " "Rust generally doesn’t like inexplicit things, like automatic unwrapping or "
"for instance using booleans as integers." "for instance using booleans as integers."
msgstr "" msgstr ""
"Rust عمومًا لا يحب الأشياء غير الواضحة، مثل فك التغليف التلقائي (automatic "
"unwrapping) أو على سبيل المثال استخدام القيم المنطقية (booleans) كأعداد "
"صحيحة (integers)."
#: src/user-defined-types/tuple-structs.md #: src/user-defined-types/tuple-structs.md
msgid "Operator overloading is discussed on Day 3 (generics)." msgid "Operator overloading is discussed on Day 3 (generics)."
msgstr "" msgstr ""
"يتم مناقشة التحميل الزائد للمشغل (Operator overloading) في اليوم الثالث (Day "
"3) (الأنواع العامة (generics))."
#: src/user-defined-types/tuple-structs.md #: src/user-defined-types/tuple-structs.md
msgid "" msgid ""
"The example is a subtle reference to the [Mars Climate Orbiter](https://en." "The example is a subtle reference to the [Mars Climate Orbiter](https://en."
"wikipedia.org/wiki/Mars_Climate_Orbiter) failure." "wikipedia.org/wiki/Mars_Climate_Orbiter) failure."
msgstr "" msgstr ""
"المثال هو إشارة دقيقة إلى فشل [Mars Climate Orbiter](https://en.wikipedia."
"org/wiki/Mars_Climate_Orbiter)."
#: src/user-defined-types/enums.md #: src/user-defined-types/enums.md
msgid "" msgid ""
"The `enum` keyword allows the creation of a type which has a few different " "The `enum` keyword allows the creation of a type which has a few different "
"variants:" "variants:"
msgstr "" msgstr ""
"الكلمة المفتاحية `enum` تسمح بإنشاء نوع يحتوي على عدة متغيرات مختلفة "
"(variants):"
#: src/user-defined-types/enums.md #: src/user-defined-types/enums.md
msgid "// Simple variant\n" msgid "// Simple variant\n"
msgstr "" msgstr "// متغير بسيط (Simple variant)\n"
#: src/user-defined-types/enums.md #: src/user-defined-types/enums.md
msgid "// Tuple variant\n" msgid "// Tuple variant\n"
msgstr "" msgstr "// متغير ترتيب (Tuple variant)\n"
#: src/user-defined-types/enums.md #: src/user-defined-types/enums.md
msgid "// Struct variant\n" msgid "// Struct variant\n"
msgstr "" msgstr "// متغير هيكل (Struct variant)\n"
#: src/user-defined-types/enums.md #: src/user-defined-types/enums.md
msgid "\"On this turn: {:?}\"" msgid "\"On this turn: {:?}\""
msgstr "" msgstr "\"في هذه الدورة: {:?}\""
#: src/user-defined-types/enums.md #: src/user-defined-types/enums.md
msgid "Enumerations allow you to collect a set of values under one type." msgid "Enumerations allow you to collect a set of values under one type."
msgstr "" msgstr "التعدادات (Enumerations) تسمح لك بجمع مجموعة من القيم تحت نوع واحد."
#: src/user-defined-types/enums.md #: src/user-defined-types/enums.md
msgid "" msgid ""
"`Direction` is a type with variants. There are two values of `Direction`: " "`Direction` is a type with variants. There are two values of `Direction`: "
"`Direction::Left` and `Direction::Right`." "`Direction::Left` and `Direction::Right`."
msgstr "" msgstr ""
"`Direction` هو نوع يحتوي على متغيرات (variants). هناك قيمتان لـ `Direction`: "
"`Direction::Left` و `Direction::Right`."
#: src/user-defined-types/enums.md #: src/user-defined-types/enums.md
msgid "" msgid ""
@ -4712,16 +4793,21 @@ msgid ""
"Rust will store a discriminant so that it knows at runtime which variant is " "Rust will store a discriminant so that it knows at runtime which variant is "
"in a `PlayerMove` value." "in a `PlayerMove` value."
msgstr "" msgstr ""
"`PlayerMove` هو نوع يحتوي على ثلاثة متغيرات (variants). بالإضافة إلى "
"الحمولات (payloads)، سيخزن Rust مميزًا (discriminant) حتى يعرف في وقت التشغيل "
"(runtime) أي متغير موجود في قيمة `PlayerMove`."
#: src/user-defined-types/enums.md #: src/user-defined-types/enums.md
msgid "This might be a good time to compare structs and enums:" msgid "This might be a good time to compare structs and enums:"
msgstr "" msgstr "قد يكون هذا وقتًا جيدًا لمقارنة الهياكل (structs) والتعدادات (enums):"
#: src/user-defined-types/enums.md #: src/user-defined-types/enums.md
msgid "" msgid ""
"In both, you can have a simple version without fields (unit struct) or one " "In both, you can have a simple version without fields (unit struct) or one "
"with different types of fields (variant payloads)." "with different types of fields (variant payloads)."
msgstr "" msgstr ""
"في كليهما، يمكنك الحصول على نسخة بسيطة بدون حقول (unit struct) أو واحدة "
"تحتوي على أنواع مختلفة من الحقول (variant payloads)."
#: src/user-defined-types/enums.md #: src/user-defined-types/enums.md
msgid "" msgid ""
@ -4729,14 +4815,17 @@ msgid ""
"structs but then they wouldn’t be the same type as they would if they were " "structs but then they wouldn’t be the same type as they would if they were "
"all defined in an enum." "all defined in an enum."
msgstr "" msgstr ""
"يمكنك حتى تنفيذ المتغيرات المختلفة (variants) لتعداد (enum) باستخدام هياكل "
"منفصلة (separate structs) ولكنها لن تكون من نفس النوع كما لو كانت جميعها "
"معرفة في تعداد (enum)."
#: src/user-defined-types/enums.md #: src/user-defined-types/enums.md
msgid "Rust uses minimal space to store the discriminant." msgid "Rust uses minimal space to store the discriminant."
msgstr "" msgstr "Rust يستخدم مساحة صغيرة لتخزين المميز (discriminant)."
#: src/user-defined-types/enums.md #: src/user-defined-types/enums.md
msgid "If necessary, it stores an integer of the smallest required size" msgid "If necessary, it stores an integer of the smallest required size"
msgstr "" msgstr "إذا لزم الأمر، فإنه يخزن عددًا صحيحًا (integer) بأصغر حجم مطلوب."
#: src/user-defined-types/enums.md #: src/user-defined-types/enums.md
msgid "" msgid ""
@ -4745,30 +4834,41 @@ msgid ""
"optimization\"). For example, `Option<&u8>` stores either a pointer to an " "optimization\"). For example, `Option<&u8>` stores either a pointer to an "
"integer or `NULL` for the `None` variant." "integer or `NULL` for the `None` variant."
msgstr "" msgstr ""
"إذا لم تغطي القيم المسموح بها للمتغيرات (variant values) جميع أنماط البتات "
"(bit patterns)، فسيستخدم أنماط البتات غير الصالحة (invalid bit patterns) "
"لترميز المميز (discriminant) (تحسين الفجوة (niche optimization)). على سبيل "
"المثال، `Option<&u8>` يخزن إما مؤشرًا إلى عدد صحيح (integer) أو `NULL` "
"للمتغير `None`."
#: src/user-defined-types/enums.md #: src/user-defined-types/enums.md
msgid "" msgid ""
"You can control the discriminant if needed (e.g., for compatibility with C):" "You can control the discriminant if needed (e.g., for compatibility with C):"
msgstr "" msgstr ""
"يمكنك التحكم في المميز (discriminant) إذا لزم الأمر (على سبيل المثال، "
"للتوافق مع C):"
#: src/user-defined-types/enums.md #: src/user-defined-types/enums.md
msgid "" msgid ""
"Without `repr`, the discriminant type takes 2 bytes, because 10001 fits 2 " "Without `repr`, the discriminant type takes 2 bytes, because 10001 fits 2 "
"bytes." "bytes."
msgstr "" msgstr ""
"بدون `repr`، يأخذ نوع المميز (discriminant type) 2 بايت، لأن 10001 يناسب 2 "
"بايت."
#: src/user-defined-types/enums.md src/user-defined-types/static.md #: 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/review.md src/memory-management/move.md
#: src/memory-management/copy-types.md src/smart-pointers/box.md #: src/memory-management/copy-types.md src/smart-pointers/box.md
#: src/borrowing/shared.md src/error-handling/result.md #: src/borrowing/shared.md src/error-handling/result.md
msgid "More to Explore" msgid "More to Explore"
msgstr "" msgstr "المزيد لاستكشافه"
#: src/user-defined-types/enums.md #: src/user-defined-types/enums.md
msgid "" msgid ""
"Rust has several optimizations it can employ to make enums take up less " "Rust has several optimizations it can employ to make enums take up less "
"space." "space."
msgstr "" msgstr ""
"لدى Rust العديد من التحسينات (optimizations) التي يمكن استخدامها لجعل "
"التعدادات (enums) تشغل مساحة أقل."
#: src/user-defined-types/enums.md #: src/user-defined-types/enums.md
msgid "" msgid ""
@ -4776,6 +4876,8 @@ msgid ""
"option/#representation), Rust guarantees that `size_of::<T>()` equals " "option/#representation), Rust guarantees that `size_of::<T>()` equals "
"`size_of::<Option<T>>()`." "`size_of::<Option<T>>()`."
msgstr "" msgstr ""
"تحسين المؤشر الفارغ (Null pointer optimization): بالنسبة لبعض الأنواع "
"(types)، يضمن Rust أن `size_of::<T>()` يساوي `size_of::<Option<T>>()`."
#: src/user-defined-types/enums.md #: src/user-defined-types/enums.md
msgid "" msgid ""
@ -4783,24 +4885,29 @@ msgid ""
"like in practice. It's important to note that the compiler provides no " "like in practice. It's important to note that the compiler provides no "
"guarantees regarding this representation, therefore this is totally unsafe." "guarantees regarding this representation, therefore this is totally unsafe."
msgstr "" msgstr ""
"كود مثال إذا كنت تريد إظهار كيف يمكن أن تبدو التمثيلات الثنائية (bitwise "
"representation) في الممارسة العملية. من المهم ملاحظة أن المترجم (compiler) "
"لا يقدم أي ضمانات بخصوص هذا التمثيل، لذلك هذا غير آمن تمامًا."
#: src/user-defined-types/static.md #: src/user-defined-types/static.md
msgid "`static`" msgid "`static`"
msgstr "" msgstr "`static`"
#: src/user-defined-types/static.md #: src/user-defined-types/static.md
msgid "" msgid ""
"Static variables will live during the whole execution of the program, and " "Static variables will live during the whole execution of the program, and "
"therefore will not move:" "therefore will not move:"
msgstr "" msgstr ""
"المتغيرات الثابتة (Static variables) ستظل موجودة طوال تنفيذ البرنامج "
"بالكامل، وبالتالي لن تتحرك:"
#: src/user-defined-types/static.md #: src/user-defined-types/static.md
msgid "\"Welcome to RustOS 3.14\"" msgid "\"Welcome to RustOS 3.14\""
msgstr "" msgstr "\"Welcome to RustOS 3.14\""
#: src/user-defined-types/static.md #: src/user-defined-types/static.md
msgid "\"{BANNER}\"" msgid "\"{BANNER}\""
msgstr "" msgstr "\"{BANNER}\""
#: src/user-defined-types/static.md #: src/user-defined-types/static.md
msgid "" msgid ""
@ -4811,16 +4918,27 @@ msgid ""
"globally-scoped value does not have a reason to need object identity, " "globally-scoped value does not have a reason to need object identity, "
"`const` is generally preferred." "`const` is generally preferred."
msgstr "" msgstr ""
"كما هو مذكور في [Rust RFC Book](https://rust-lang.github.io/rfcs/0246-const-"
"vs-static.html)، هذه المتغيرات لا يتم تضمينها عند الاستخدام ولها موقع ذاكرة "
"فعلي مرتبط. هذا مفيد للكود غير الآمن (unsafe) والمضمن (embedded)، ويظل "
"المتغير موجودًا طوال تنفيذ البرنامج بالكامل. عندما لا يكون للقيمة ذات النطاق "
"العالمي سبب للحاجة إلى هوية الكائن (object identity)، يفضل استخدام `const` "
"بشكل عام."
#: src/user-defined-types/static.md #: src/user-defined-types/static.md
msgid "`static` is similar to mutable global variables in C++." msgid "`static` is similar to mutable global variables in C++."
msgstr "" msgstr ""
"`static` مشابه للمتغيرات العالمية القابلة للتغيير (mutable global variables) "
"في C++."
#: src/user-defined-types/static.md #: src/user-defined-types/static.md
msgid "" msgid ""
"`static` provides object identity: an address in memory and state as " "`static` provides object identity: an address in memory and state as "
"required by types with interior mutability such as `Mutex<T>`." "required by types with interior mutability such as `Mutex<T>`."
msgstr "" msgstr ""
"`static` يوفر هوية الكائن (object identity): عنوان في الذاكرة وحالة كما هو "
"مطلوب من الأنواع ذات القابلية للتغيير الداخلي (interior mutability) مثل "
"`Mutex<T>`."
#: src/user-defined-types/static.md #: src/user-defined-types/static.md
msgid "" msgid ""
@ -4828,56 +4946,74 @@ msgid ""
"`Sync`. Interior mutability is possible through a [`Mutex`](https://doc.rust-" "`Sync`. Interior mutability is possible through a [`Mutex`](https://doc.rust-"
"lang.org/std/sync/struct.Mutex.html), atomic or similar." "lang.org/std/sync/struct.Mutex.html), atomic or similar."
msgstr "" msgstr ""
"نظرًا لأن المتغيرات الثابتة (`static` variables) يمكن الوصول إليها من أي خيط "
"(thread)، يجب أن تكون `Sync`. القابلية للتغيير الداخلي (Interior mutability) "
"ممكنة من خلال [`Mutex`](https://doc.rust-lang.org/std/sync/struct.Mutex."
"html)، الذري (atomic) أو ما شابه."
#: src/user-defined-types/static.md #: src/user-defined-types/static.md
msgid "Thread-local data can be created with the macro `std::thread_local`." msgid "Thread-local data can be created with the macro `std::thread_local`."
msgstr "" msgstr ""
"يمكن إنشاء البيانات المحلية للخيط (Thread-local data) باستخدام الماكرو `std::"
"thread_local`."
#: src/user-defined-types/const.md #: src/user-defined-types/const.md
msgid "`const`" msgid "`const`"
msgstr "" msgstr "`const`"
#: src/user-defined-types/const.md #: src/user-defined-types/const.md
msgid "" msgid ""
"Constants are evaluated at compile time and their values are inlined " "Constants are evaluated at compile time and their values are inlined "
"wherever they are used:" "wherever they are used:"
msgstr "" msgstr ""
"يتم تقييم الثوابت (Constants) في وقت الترجمة (compile time) ويتم تضمين قيمها "
"في أي مكان يتم استخدامها فيه:"
#: src/user-defined-types/const.md #: src/user-defined-types/const.md
msgid "" msgid ""
"According to the [Rust RFC Book](https://rust-lang.github.io/rfcs/0246-const-" "According to the [Rust RFC Book](https://rust-lang.github.io/rfcs/0246-const-"
"vs-static.html) these are inlined upon use." "vs-static.html) these are inlined upon use."
msgstr "" msgstr ""
"وفقًا لـ [Rust RFC Book](https://rust-lang.github.io/rfcs/0246-const-vs-"
"static.html) يتم تضمين هذه القيم عند الاستخدام."
#: src/user-defined-types/const.md #: src/user-defined-types/const.md
msgid "" msgid ""
"Only functions marked `const` can be called at compile time to generate " "Only functions marked `const` can be called at compile time to generate "
"`const` values. `const` functions can however be called at runtime." "`const` values. `const` functions can however be called at runtime."
msgstr "" msgstr ""
"فقط الدوال المميزة بـ `const` يمكن استدعاؤها في وقت الترجمة (compile time) "
"لتوليد قيم `const`. ومع ذلك، يمكن استدعاء الدوال `const` في وقت التشغيل "
"(runtime)."
#: src/user-defined-types/const.md #: src/user-defined-types/const.md
msgid "Mention that `const` behaves semantically similar to C++'s `constexpr`" msgid "Mention that `const` behaves semantically similar to C++'s `constexpr`"
msgstr "" msgstr "اذكر أن `const` يتصرف بشكل مشابه دلاليًا لـ `constexpr` في C++."
#: src/user-defined-types/const.md #: src/user-defined-types/const.md
msgid "" msgid ""
"It isn't super common that one would need a runtime evaluated constant, but " "It isn't super common that one would need a runtime evaluated constant, but "
"it is helpful and safer than using a static." "it is helpful and safer than using a static."
msgstr "" msgstr ""
"ليس من الشائع جدًا أن يحتاج المرء إلى ثابت يتم تقييمه في وقت التشغيل (runtime "
"evaluated constant)، ولكنه مفيد وأكثر أمانًا من استخدام ثابت (static)."
#: src/user-defined-types/aliases.md #: src/user-defined-types/aliases.md
msgid "" msgid ""
"A type alias creates a name for another type. The two types can be used " "A type alias creates a name for another type. The two types can be used "
"interchangeably." "interchangeably."
msgstr "" msgstr ""
"الاسم المستعار للنوع (type alias) ينشئ اسمًا لنوع آخر. يمكن استخدام النوعين "
"بالتبادل."
#: src/user-defined-types/aliases.md #: src/user-defined-types/aliases.md
msgid "// Aliases are more useful with long, complex types:\n" msgid "// Aliases are more useful with long, complex types:\n"
msgstr "" msgstr ""
"// الأسماء المستعارة (Aliases) تكون أكثر فائدة مع الأنواع الطويلة والمعقدة:\n"
#: src/user-defined-types/aliases.md #: src/user-defined-types/aliases.md
msgid "C programmers will recognize this as similar to a `typedef`." msgid "C programmers will recognize this as similar to a `typedef`."
msgstr "" msgstr "مبرمجو C سيتعرفون على هذا كشيء مشابه لـ `typedef`."
#: src/user-defined-types/exercise.md #: src/user-defined-types/exercise.md
msgid "" msgid ""
@ -4886,6 +5022,10 @@ msgid ""
"various events. Use `#[derive(Debug)]` to allow the types to be formatted " "various events. Use `#[derive(Debug)]` to allow the types to be formatted "
"with `{:?}`." "with `{:?}`."
msgstr "" msgstr ""
"سنقوم بإنشاء هيكل بيانات (data structure) لتمثيل حدث في نظام التحكم في "
"المصعد. الأمر متروك لك لتحديد الأنواع (types) والدوال (functions) لبناء "
"الأحداث المختلفة. استخدم `#[derive(Debug)]` للسماح بتنسيق الأنواع باستخدام "
"`{:?}`."
#: src/user-defined-types/exercise.md #: src/user-defined-types/exercise.md
msgid "" msgid ""
@ -4893,11 +5033,9 @@ msgid ""
"`main` runs without errors. The next part of the course will cover getting " "`main` runs without errors. The next part of the course will cover getting "
"data out of these structures." "data out of these structures."
msgstr "" msgstr ""
"يتطلب هذا التمرين فقط إنشاء وملء هياكل البيانات (data structures) بحيث يتم "
#: src/user-defined-types/exercise.md src/user-defined-types/solution.md "تشغيل `main` بدون أخطاء. سيغطي الجزء التالي من الدورة استخراج البيانات من "
msgid "" "هذه الهياكل."
"/// An event in the elevator system that the controller must react to.\n"
msgstr ""
#: src/user-defined-types/exercise.md #: src/user-defined-types/exercise.md
msgid "// TODO: add required variants\n" msgid "// TODO: add required variants\n"