Kotlin Multiplatform Academy · درس

توطين نصوص الواجهة المشتركة

تقديم السلاسل المترجمة من الموارد المشتركة

الدرس 4 من 413 خطوة

توطين نصوص الواجهة المشتركة درس مجاني في Kotlin Multiplatform Academy على CoddyKit. هذا هو الدرس 4 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في Kotlin Multiplatform Academy، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة Kotlin Multiplatform Academy 4 دروس في المجموع.

بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.

Speak Every Language

To reach the world, your UI text must adapt to each user. Localization serves the right language from your shared resources. 🌍

Start From Shared Strings

Localization builds on the shared strings you already defined. You keep the same keys but add translations for each language.

Folders per Language

You add a values folder tagged with a language code, like values-es for Spanish. Each holds the same keys, translated.

Same Key, Different Text

The key welcome exists in every folder. Only the value changes, so your code never has to know the language.

<string name="welcome">Bienvenido de nuevo!</string>

The Default Folder

The plain values folder is your fallback. If a translation is missing, Compose shows this default text instead of crashing.

Code Stays Unchanged

Your screen still calls stringResource with the same key. The right language is picked automatically at runtime.

Text(stringResource(Res.string.welcome))

Compose Reads the Locale

Compose checks the device locale and selects the matching folder. Spanish devices get values-es, others get the default.

Plurals Need Care

One item versus many needs different wording. A plural resource lets each language choose the correct form for a count.

Text(pluralStringResource(Res.plurals.items, count, count))

Format With Arguments

Word order differs by language. Use placeholders so each translation arranges values naturally for its grammar.

<string name="greeting">Hola, %1$s!</string>

Test in Multiple Languages

Switch the device or emulator language and rerun. Seeing real translations early catches layout and length surprises. ✅

One Codebase, Many Locales

Because translations live in shared resources, both apps localize from the same files. Add a language once, ship it everywhere. 🙂

Quick Check

How do you provide Spanish text for an existing string key?

Recap: Worldwide From Shared Code

You added locale folders, kept the same keys, and let Compose pick the language automatically. One codebase, many locales. 🌐

البدء مجانًا

تعلم Kotlin مع معلم ذكاء اصطناعي — مجانًا

اكتب وقم بتشغيل أكوادك الفعلية في المتصفح، واحصل على مساعدة فورية من معلم ذكاء اصطناعي متاح 24/7، واستمر من حيث توقفت على الويب أو في التطبيق.

الدورات
30
الدروس
120

الأسئلة الشائعة

هل درس «توطين نصوص الواجهة المشتركة» مجاني؟

نعم — نص درس «توطين نصوص الواجهة المشتركة» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة Kotlin Multiplatform Academy، انتقل إلى CoddyKit PRO. تتضمن دورة Kotlin Multiplatform Academy 4 دروس في المجموع.

ماذا ستتعلم في «توطين نصوص الواجهة المشتركة»؟

تقديم السلاسل المترجمة من الموارد المشتركة تتمرن على Kotlin Multiplatform Academy مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.

هل أحتاج إلى خبرة سابقة لأبدأ Kotlin Multiplatform Academy؟

لا تُشترط خبرة سابقة. Kotlin Multiplatform Academy على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 4 من أصل 4.

كم من الوقت يستغرق درس «توطين نصوص الواجهة المشتركة»؟

معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.

هل يمكنني كتابة وتشغيل أكواد في درس Kotlin Multiplatform Academy هذا؟

نعم. كل درس في Kotlin Multiplatform Academy يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.

جميع الدروس في هذه الدورة

  1. التنقل بين الشاشات المشتركة
  2. تمرير المعاملات والروابط العميقة
  3. الصور والخطوط والسلاسل المشتركة
  4. توطين نصوص الواجهة المشتركة
← العودة إلى Kotlin Multiplatform Academy