اختبار تطبيقك باستخدام الأسماء الزائفة
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
اللغة الزائفة هي لغة مصمّمة لمحاكاة خصائص
اللغات التي تتسبب في حدوث مشاكل في واجهة المستخدم والتنسيق وغيرها من المشاكل المتعلّقة بالترجمة عند ترجمة
تطبيق. يتم إنشاء اللغات الزائفة من خلال ترجمات فورية وتلقائية
تكون قابلة للقراءة باللغة الإنجليزية لجميع الرسائل القابلة للترجمة.
يشير النص الذي لم يتمّت ترجمة محتواه إلى رسائل لا يمكن ترجمتها في رمز المصدر.
توفّر اللغات الزائفة الوقت
والمال لأنّه يمكنك إجراء تعديلات على نص واجهة المستخدم وتنسيقه قبل
إرسال رسائلك إلى مستودع المصدر لإرسالها للترجمة
لاحقًا. للحصول على قائمة بالمشاكل المحتمَلة في الترجمة، يُرجى الاطّلاع على القسم
رصد مشاكل الأقلمة.
الشكل 1: اللغة الزائفة الإنجليزية (XA)
تلتزم أسماء اللغات الزائفة في Android باصطلاحات التسمية العادية للغات، ويمكن تحليل معرّفات اللغات باستخدام أي لغة برمجة متوافقة مع معيار BCP 47.
من هذا المنطلق، تشبه اللغات الزائفة أي لغات أخرى، مثل الفرنسية
أو الصينية أو الروسية.
يوفّر نظام التشغيل Android اللغتَين الوهميتين التاليتَين لتمثيل
اللغات التي تُكتب من اليسار إلى اليمين (LTR) واللغات التي تُكتب من اليمين إلى اليسار (RTL):
الشكل 2: لغة زائفة (AR (XB))
الإنجليزية (XA): تضيف علامات النبر اللاتينية إلى نص واجهة المستخدم الأساسية باللغة الإنجليزية، وتوسّع
النص الأصلي عن طريق إضافة نص بدون علامات نبر، وتضع قوسًا حول كل وحدة رسالة لكشف الصعوبات المحتمَلة في النص الموسّع. يمكن أن تكون المشاكل المحتملة هي عدم اتّساق التنسيق
وبنية الرسالة غير الصالحة، مثل جملة مجزّأة
إلى أجزاء متعددة تظهر كرسائل متعددة بين قوسين. يظهر التنسيق pseudolocale باللغة الإنجليزية (XA)
في الشكل 1.
AR (XB): لضبط اتجاه النص في الرسائل الأصلية من اليسار إلى اليمين على
اتجاه من اليمين إلى اليسار، ما يؤدي إلى عكس ترتيب الأحرف في
الرسالة الأصلية. يظهر نطاقها الجغرافي الاصطناعي AR (XB) في الشكل 2.
يمكن أن تساعدك اللغات الزائفة في إنشاء إصدار من تطبيقك باتجاه RTL، حتى إذا لم تكن تتعلّم
أي لغات باتجاه RTL أو تتحدثها.
تفعيل اللغات الزائفة
تتم عادةً إضافة اللغات الزائفة إلى الإصدارات الموجَّهة للمطوّرين. عند اختيار
لغة وهمية على جهازك، تأخذ كل التطبيقات التي تتيح اللغات الوهمية
سمات اللغة الوهمية المحدّدة، بما في ذلك جميع تطبيقات النظام
مثل تطبيق "الإعدادات" ولوحة "الإعدادات السريعة".
لاستخدام لغات Android الزائفة، يجب أن يعمل جهازك بنظام التشغيل
Android 4.3 (المستوى 18 لواجهة برمجة التطبيقات) أو إصدار أحدث وأن تكون خيارات المطوّر مفعّلة عليه. يجب أيضًا إعادة تشغيل جهازك بعد تفعيل خيارات المطوّر.
توضِّح الخطوات التالية كيفية تفعيل اللغات الزائفة:
في Android Studio، يمكنك تفعيل اللغات الزائفة لتطبيق معيّن عن طريق إضافة الإعدادات التالية إلى ملف build.gradle
:
Kotlin
android {
...
buildTypes.getByName("debug") {
isPseudoLocalesEnabled = true
}
}
إنشاء تطبيقك وتشغيله
الشكل 3: اختَر لغة وهمية.
استخدِم تطبيق "الإعدادات" لاختيار لغة وهمية. تختلف هذه الخطوة حسب
إصدار Android، على النحو التالي:
الإصدار 5.0 من نظام التشغيل Android (المستوى 21 لواجهة برمجة التطبيقات) أو إصدار أحدث
- على الجهاز، افتح تطبيق "الإعدادات" وانقر على اللغات والإدخال >
الإعدادات المفضّلة للّغة.
- في قائمة الإعدادات المفضّلة للّغة، اسحب علامة التبويب لنقل لغة اصطناعية إلى أعلى القائمة وجعلها اللغة النشطة.
راجِع الشكل 3.
Android 4.4.4 (المستوى 19 لواجهة برمجة التطبيقات) أو إصدار أقدم
- على الجهاز، افتح تطبيق "الإعدادات" وانقر على اللغات والإدخال >
الإعدادات المفضّلة للّغة > إضافة لغة.
- انقر على لغة وهمية لإضافتها إلى قائمة الإعدادات المفضّلة للّغة.
- في قائمة إعدادات اللغة المفضّلة، اسحب علامة التبويب لنقل ملف ترجمة ملف ترجمة
pseudolocale إلى أعلى القائمة وجعله اللغة النشطة
راجِع الشكل 3.
رصد مشاكل الأقلمة
توفّر اللغات الزائفة طريقة فعالة وتوفر الوقت لرصد أي مشكلات محتملة في
قابلية الترجمة في واجهة المستخدم، وذلك من خلال مساعدتك في تحديد المشاكل في
المجالات التالية:
- تظهر السلاسل الثابتة التي لا يمكن إرسالها للترجمة كنص بدون علامات نبر في اللغة الزائفة لجعلها ملحوظة.
- مشاكل في تنسيق واجهة المستخدم ناتجة عن توسيع النص، وتوضّح الأماكن التي يمكن أن تنقطع فيها واجهة المستخدم
بسبب طول النص
تسلسل السلاسل، الذي يظهر كرسالة واحدة مقسمة على قوسَين أو
أكثر وقد يؤدي ذلك إلى صعوبة الترجمة الصحيحة، لأنّ المترجمين
عليهم ترجمة كل جزء بشكل مستقل بدون معرفة أنّ الأجزاء
مترابطة. يمكن أن تجعل تسلسل السلاسل الترجمة الصحيحة مستحيلة،
لأنّ اللغات المختلفة
قد تتطلّب ترتيبًا مختلفًا للأجزاء أو بنية جمل مختلفة تمامًا. على سبيل المثال، في لغات مثل اليابانية والكورية
والتاميلية، يُوضع الفعل في نهاية الجملة. عند تسلسل الجملة،
لا يمكن للمترجمين تغيير ترتيب الكلمات حسب الحاجة.
مشاكل النصّ ثنائي الاتجاه (BIDI)، مثل عندما يتضمّن المحتوى في اتجاه واحد من النص
عبارة مضمّنة في الاتجاه المقابل للنص، ما يجعل من الصعب قراءة السلسلة
مشاكل الكتابة من اليمين إلى اليسار، مثل عدم عكس العناصر تشمل بعض الأمثلة على ذلك عدم تحرّك عنصر واجهة المستخدم إلى اليسار أو عدم عكس النص ونقله إلى
اليسار أو استخدام علامات ترقيم في غير محلها، مثل تحويل "pseudolocales rule!" إلى
"elur selacoloduesp!" بدلاً من "!elur selacoloduesp".
يخضع كل من المحتوى وعيّنات التعليمات البرمجية في هذه الصفحة للتراخيص الموضحّة في ترخيص استخدام المحتوى. إنّ Java وOpenJDK هما علامتان تجاريتان مسجَّلتان لشركة Oracle و/أو الشركات التابعة لها.
تاريخ التعديل الأخير: 2025-07-27 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","easyToUnderstand","thumb-up"],["ساعَدني المحتوى في حلّ مشكلتي.","solvedMyProblem","thumb-up"],["غير ذلك","otherUp","thumb-up"]],[["لا يحتوي على المعلومات التي أحتاج إليها.","missingTheInformationINeed","thumb-down"],["الخطوات معقدة للغاية / كثيرة جدًا.","tooComplicatedTooManySteps","thumb-down"],["المحتوى قديم.","outOfDate","thumb-down"],["ثمة مشكلة في الترجمة.","translationIssue","thumb-down"],["مشكلة في العيّنات / التعليمات البرمجية","samplesCodeIssue","thumb-down"],["غير ذلك","otherDown","thumb-down"]],["تاريخ التعديل الأخير: 2025-07-27 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],null,["# Test your app with pseudolocales\n\nA pseudolocale is a locale that is designed to simulate characteristics of\nlanguages that cause UI, layout, and other translation-related problems when an\napp\nis translated. Pseudolocales are created by instant and automatic translations\nthat are readable in English for all *localizable* messages.\nUn-pseudolocalized text points to untranslatable messages in your source code.\n\nPseudolocales save time\nand money because you can make adjustments to the UI text and its layout before\nyou commit your messages to the source repository to be sent for translation\nlater. For a list of potential translation problems, see the\n[Spot localization issues](#spot_localization_issues) section. \n\n**Figure 1.** English (XA) pseudolocale.\n\nThe Android pseudolocale names follow standard locale naming conventions, and\ntheir locale IDs can be parsed by any BCP 47 compliant programming language.\nIn this sense, pseudolocales are just like any other locales, such as French,\nChinese, or Russian.\n\nThe Android platform provides the following two pseudolocales to represent\nleft-to-right (LTR) and right-to-left (RTL) languages: \n\n**Figure 2.** AR (XB) pseudolocale.\n\n**English (XA):** adds Latin accents to the base English UI text, expands the\noriginal text by adding non-accented text, and brackets each message unit to\nexpose potential issues from expanded text. Potential issues can be layout\nbreakage and badly formed message syntax, such as a sentence split\ninto multiple parts displaying as multiple bracketed messages. The English (XA)\npseudolocale is shown in figure 1.\n\n**AR (XB):** sets the text direction of the original left-to-right messages to\nthe right-to-left direction, which reverses the order of the characters in the\noriginal message. The AR (XB) pseudolocale is shown in figure 2.\n\nPseudolocales can help you make an RTL version of your app, even if you don't\nwrite or speak any RTL languages.\n\nEnable pseudolocales\n--------------------\n\nPseudolocales are usually added to developer-oriented builds. When you choose a\npseudolocale on your device, all the apps that support pseudolocales take on\nthe characteristics of the selected pseudolocale, including all the system apps\nsuch as the Settings app and Quick Settings panel.\n\n\u003cbr /\u003e\n\n\nTo use the Android pseudolocales, you must be running\nAndroid 4.3 (API level 18) or higher and have\n[developer options](/studio/debug/dev-options) enabled\non your device. You must also reboot your device after enabling\ndeveloper options.\n\nThe following procedure explains how to enable pseudolocales:\n\n1. In Android Studio, enable pseudolocales for a specific app by adding the\n following configuration to your `build.gradle` file:\n\n ### Groovy\n\n ```groovy\n android {\n ...\n buildTypes {\n debug {\n pseudoLocalesEnabled true\n }\n }\n }\n ```\n\n ### Kotlin\n\n ```kotlin\n android {\n ...\n buildTypes.getByName(\"debug\") {\n isPseudoLocalesEnabled = true\n }\n }\n ```\n2. [Build and run your app](/studio/run).\n\n **Figure 3.** Select a pseudolocale.\n3. Use the Settings app to select a pseudolocale. This step varies based on your\n Android version, as follows:\n\n **Android 5.0 (API level 21) or higher**\n 1. On the device, open the Settings app and tap **Languages and input \\\u003e\n Language preferences**.\n 2. In the **Language preferences** list, drag the tab to move a pseudolocale to the top of the list and make it the active language. See figure 3.\n\n **Android 4.4.4 (API level 19) or lower**\n 1. On the device, open the Settings app and tap **Languages and input \\\u003e\n Language preferences \\\u003e Add a language**.\n 2. Tap a pseudolocale to add it to the **Language preferences** list.\n 3. In the **Language preferences** list, drag the tab to move a pseudolocale to the top of the list and make it the active language See figure 3.\n\nSpot localization issues\n------------------------\n\nPseudolocales provide a time-saving and effective way to spot potential\nlocalizability issues in the UI by helping you identify problems in the\nfollowing areas:\n\n- Hardcoded strings, which can't be sent to translation, display as unaccented text in the pseudolocale to make them noticeable.\n- UI layout issues caused by text expansion, showing where the UI can break due to text length.\n- String concatenation, which displays as one message split across two or\n more brackets. This can make correct translation difficult, because translators\n have to translate each part independently without knowing that the parts\n are related. String concatenation can also make correct translation impossible,\n because different\n languages might require a different order of parts or a completely different\n sentence structure. For example, languages such as Japanese, Korean, and\n Tamil place the verb at the end of a sentence. When a sentence is concatenated,\n translators can't change the word order as needed.\n\n- Bidirectional (BIDI) text problems, such as when content in one text\n direction\n includes an inline phrase in the opposite text direction, making the string\n difficult to read.\n\n- Right-to-left (RTL) problems, such as elements not being mirrored. Some examples are\n a UI element not moving to the left, text not reversing and moving to the\n left, or misplaced punctuation, such as \"pseudolocales rule!\" changing to\n \"elur selacoloduesp!\" instead of \"!elur selacoloduesp\"."]]