Category: Open-source

  • Theme وTemplate في واجهات ووردبريس العربية: كيف نتجنب الغموض الدلالي؟

    بصفتي مهندس تعريب (L10n Engineer) متخصص في اللغة العربية، وأستهدف بخطابي المهني أسواقاً خليجية رائدة مثل المملكة العربية السعودية والإمارات العربية المتحدة، أؤكد أن توطين واجهات المستخدم (UI Localization) يتجاوز بكثير الاستبدال الحرفي للكلمات، بل يستلزم وضوحاً سياقياً (Contextual Clarity) صارماً. في مجال توطين البرمجيات (Software Localization – L10n)، نادراً ما يثير أي تحدٍ جدلاً واسعاً مثلما تثيره المصطلحات المصدرية التي تُترجم إلى كلمة واحدة متطابقة في قاعدة المصطلحات (Glossary) العربية الافتراضية. والمثال الكلاسيكي على ذلك يبرز في أنظمة إدارة المحتوى (CMS) عند التمييز بين “Theme” و “Template”.

    في اللغة الإنجليزية، يحمل المصطلحان أدواراً تقنية متمايزة:

    • Theme: الهوية البصرية الشاملة، ولوحة الألوان، وإعدادات الخطوط المسبقة، وطبقة التنسيق المرئي.
    • Template: التخطيط الهيكلي، أو الهيكل الأساسي للصفحة (Page Skeleton)، أو المخطط الذي يحدد مواقع مكونات المحتوى.

    ومع ذلك، تُسند قواعد المصطلحات العربية (Arabic Glossaries) غالباً كلمة “قالب” لكلا المفهومين. وبينما يصف مصطلح “قالب” بدقة الهيكل الإنشائي، فإن استخدامه لكلا المصطلحين في نص واجهة واحد يخلق تعارضاً دلالياً حاداً (Severe Semantic Collision).

    التعارض الدلالي على أرض الواقع (كما يظهر في الصورة المرفقة)

    خذ بعين الاعتبار نص رسالة الخطأ الموضحة في الصورة:

    “No theme is defined for this template.”

    إذا تمت ترجمتها حرفياً باستخدام “قالب” لكلا المصطلحين، فستكون النتيجة:

    “لم يتم تحديد قالب لهذا القالب.”

    هذه الصياغة غامضة منطقياً وتقوض تجربة المستخدم (User Experience – UX)، وتترك المطورين ومسؤولي المواقع والمستخدمين النهائيين في حيرة حول ما إذا كان النظام يفتقر إلى نظام تصميم (Design System) أم إلى تخطيط هيكلي للصفحة.

    حل الغموض باعتماد مصطلح “مظهر”

    لتأسيس نصوص واجهة عربية واضحة ومهنية وواعية بالسياق، يجب علينا التمييز بوضوح بين العرض المرئي والهيكل الإنشائي. الترجمة المثلى المعتمدة لهذا النص هي:

    “لم يتم تحديد مظهر لهذا القالب.”

    من خلال حصر استخدام “قالب” بشكل صارم لمصطلح Template (الهيكل)، وتبني مصطلح “مظهر” (أو “سمة”) لمصطلح Theme (المظهر البصري/التنسيق)، فإننا نحقق إنجازات متعددة في هندسة التعريب (L10n Milestones):

    1. الدقة والوضوح الوظيفي (Precision & Functional Clarity): يدرك المستخدمون فوراً أن “مظهر” يشير إلى قواعد التصميم المرئي أو التنسيق النشط المطبق على المخطط الهيكلي الأساسي (القالب). لقد اخترنا هذا المصطلح تحديداً للتركيز على المظهر البصري (Focusing on Visual Appearance)، مما يمنع أي لبس وظيفي.
    2. تناسق قاعدة المصطلحات (Glossary Harmony): يؤدي تمييز هذه المصطلحات إلى منع تعارض مدخلات ذاكرة الترجمة (Translation Memory – TM) وتجنب الغموض المصطلحي (Terminological Ambiguity) عبر مشاريع التعريب متعددة المطورين.
    3. الاتساق عبر المنظومات التقنية (Consistency Across Ecosystems): يضمن توحيد المصطلحات عبر نواة ووردبريس (WordPress Core)، وإضافات البلوكات (Block Plugins)، وسير عمل تحرير الموقع الكامل (Full Site Editing – FSE) حفاظ الواجهات المعربة على وضوح مؤسسي راسخ.

    في توطين البرمجيات (Software Localization)، تؤثر الدقة اللغوية تأثيراً مباشراً على سهولة الاستخدام (Usability). وعندما تُدمج قواعد المصطلحات المستهدفة (Target Glossaries) مفاهيم تقنية متمايزة في مصطلح واحد، فإن تبني نهج سياقي سلطوي (Authoritative Context-First Approach) لتحسين المصطلحات يضمن بقاء الواجهة بديهية واحترافية، وهو ما يرقى لتطلعات المستخدمين في أسواقنا المستهدفة.

  • Faster l10n with GPaste

    Make Your Software Localization Workflow Faster with GPaste

    If you work in software localization, your day is all about precision, context switching, and consistency. You translate string resource files, JSON objects, PO files—and you keep repeating the same technical patterns and terms. On Linux, GPaste is a clipboard manager that can save you a lot of keystrokes and speed up your translation pipeline.

    Why Localization Pros Need a Clipboard Manager

    Localization isn’t just about translating words. You also have to preserve structure across languages. Every time you move between a TMS, a code editor, and reference glossaries, you’re copying and pasting the same kinds of snippets. A clipboard history tool lets you capture them once and pull them up whenever you need them.

    What GPaste Helps With

    • Reusing placeholders fast: Technical tokens and format specifiers like (%s) stay within reach—no retyping.
    • Keeping terminology consistent: Common UI labels, navigation items, search components, metadata tags, and localized terms stay in your history sidebar.
    • Editing across multiple files: Jump between string files and paste specialized strings, technical components, or script references like JavaScript without losing your place.

    Getting More Efficient on Linux

    Adding a clipboard history manager to your routine removes the small friction points that slow you down. It helps you stay focused on what really matters: writing natural, context-aware translations for users around the world.


  • Precision Over Simplicity in l10n

    Why Secure Custom Field Should Translate “Render” as تَصْيير, Not عرض

    Screenshot 1: Current Arabic translation using “لعرض”

    Screenshot 2: Suggested Arabic translation using “لتَصْيير”

    As an Arabic General Translation Editor (GTE), I am committed to high-impact community work for community projects. That means every string I review is not just a word choice—it is a decision that affects thousands of Arabic-speaking developers, site builders, and contributors. Recently, while localizing Secure Custom Field (SCF), I encountered a string that perfectly illustrates the tension between technical precision and user-friendly simplicity:

    “Specify the style used to render the clone field.”

    The current Arabic translation uses لعرض (“to display”). A suggested alternative uses لتَصْيير (“to render”). Both are defensible in isolation. But for SCF, the better choice is clear: تَصْيير.

    Render Is a Process, Not Just a Result

    In software engineering, “render” has a specific meaning. It describes the computational process of generating a visual output—an image, a UI element, a DOM node, a template—from code, data, or a model. تَصْيير is the technically precise Arabic term for that process. It maps directly to browser rendering, template rendering, and field rendering.

    عرض, by contrast, translates closer to “display,” “show,” or “presentation.” It focuses on the result, not the mechanism. For a general user interface, that simplification is often ideal. The average user does not need to know how the backend builds the page; they just want to know how a field will appear on the front end.

    But Secure Custom Field is not a general user interface. It is a developer tool.

    SCF Is Generally Used by Developers

    Secure Custom Field is used by developers, agencies, and technical site builders. They create custom fields, configure clone fields, write PHP, register field groups, and integrate SCF into custom themes and plugins. Even a settings label like “Specify the style used to render the clone field” is read by someone who understands the difference between rendering and displaying.

    If we translate “render” as عرض, we flatten that distinction. A developer reading the Arabic string may wonder: Is this about CSS display? Is it about front-end presentation? Or is it about the actual rendering process of the clone field? تَصْيير removes that ambiguity. It tells the developer exactly what is being configured.

    Consistency Is Community Infrastructure

    As a GTE, my responsibility goes beyond one string. I am building a glossary that will be reused across SCF and other community projects. If we translate “render” as عرض here, what happens when the next string says “render template,” “render callback,” or “render field”? Do we translate all of them as عرض? That would erase the technical meaning. Do we switch to تَصْيير later? That would create inconsistency.

    A strong glossary says: render = تَصْيير, display = عرض. This distinction helps translators, developers, and users. It is high-impact community work because it scales. One good decision today prevents hundreds of inconsistent strings tomorrow.

    The User-Friendly Argument Has Limits

    A recent analysis of this string noted that عرض is highly natural for an average user. That is true—for average users. But SCF’s primary audience is not average users. It is developers. The argument for عرض assumes a non-technical audience that does not care about backend rendering. In SCF, that assumption is wrong.

    Yes, تَصْيير may feel slightly heavier or more academic. But in a developer-facing context, that heaviness is a feature, not a bug. It signals precision. It matches the mental model of the person configuring the field. Arabic developers deserve terminology that respects their expertise.

    RTL Readability and Technical Clarity

    Some may argue that “حدد التنسيق المستخدم لتصيير حقل النسخ” is less fluid than “حدد التنسيق المستخدم لعرض حقل النسخ.” RTL readability matters, but it should not override technical accuracy. The suggested translation is perfectly readable. It is slightly more formal, but SCF is a technical product. Formal precision is appropriate.

    Moreover, Arabic technical communities have increasingly adopted تَصْيير for rendering in development contexts. Using it in SCF aligns Arabic localization with modern technical Arabic, rather than forcing a generic UI term onto a developer tool.

    The Verdict: Use تَصْيير for SCF

    For Secure Custom Field, the better translation is:

    حدد التنسيق المستخدم لتصيير حقل النسخ

    This choice preserves the technical meaning of “render,” supports glossary consistency, and respects SCF’s developer audience. عرض remains an excellent choice for user-facing strings where “display” or “show” is the intended meaning. But SCF is not that context.

    As an Arabic GTE committed to high-impact community work, I recommend changing the current translation from لعرض to لتَصْيير. It is not about being purist. It is about being precise for the people who actually use the product. When we get terminology right for developers, we strengthen the entire Arabic WordPress ecosystem. That is community work worth doing.

  • Ellipsis in WordPress

    The Ellipsis in WordPress: Why … Beats ... Every Time

    If you’ve spent any time developing for WordPress, you’ve probably encountered this seemingly trivial question: should you use three dots (...) or the proper ellipsis character (…) in your user-facing strings?

    It might look like a minor stylistic choice, but in the WordPress ecosystem, this decision has real implications for code quality, localization, and professional polish. The WordPress core team has made their position clear—and here’s why you should follow their lead.


    The Problem with Three Dots

    Three periods might be the quickest thing to type, but they’re a typographic compromise. They’re the plain-text fallback, not the real thing.

    WordPress does have a built-in function called wptexturize() that automatically converts three periods into a proper ellipsis in post content. However, you should never rely on this for translatable strings. Here’s why:

    • Inconsistent application: wptexturize() isn’t guaranteed to run in every context—JavaScript strings, HTML attributes, or certain admin screens may bypass it entirely.
    • Unpredictable results: What works in one context might break in another, leading to visual inconsistencies across your plugin or theme.

    The WordPress Core Standard

    The WordPress core team has been systematically replacing three dots with proper ellipses for years.

    In Changeset 24207 (May 2013), core contributor SergeyBiryukov made a sweeping update across multiple files with the message: “Use ellipsis instead of three dots”. This changeset touched 16 different files, removing instances of ... from translatable strings throughout the admin.

    Then came Changeset 33939 (September 2015), with the explicit message: “Round 2 of: We should use ellipses … / … instead of three dots/periods … e.g Loading… not Loading…”.

    The message is clear: WordPress core developers actively prefer the proper ellipsis character.


    The Best Practice: Use … in Translatable Strings

    For WordPress localization (l10n), the recommended approach is to use the actual ellipsis character directly in your translatable strings:

    // ✅ Recommended
    __( 'Loading…', 'my-text-domain' );
    __( 'Continue reading…', 'my-text-domain' );
    
    // ❌ Avoid
    __( 'Loading...', 'my-text-domain' );
    __( 'Continue reading...', 'my-text-domain' );

    Why This Matters for Localization

    1. Translators need full control

    Different languages have different conventions for ellipses. Some languages use different characters, some add spaces, and some have specific rules about when and how to use them. By including the ellipsis as part of the translatable string, you give translators complete control over how it appears in their language.

    2. Context is everything

    An ellipsis on a button (“Save As…”) serves a different purpose than one indicating truncated text (“Read more…”). Keeping the ellipsis with its specific string allows translators to handle these nuances appropriately.

    3. Avoids fragmented strings

    Hard-coding punctuation outside of translatable strings can lead to awkward phrasing in other languages where word order differs.


    … vs … vs …

    You have three options for representing an ellipsis:

    OptionExampleBest Used For
    Unicode character…Translatable strings (recommended)
    HTML entity (named)…HTML templates where character encoding might be unclear
    HTML entity (numeric)…RSS feeds or contexts where named entities may break

    For translatable strings, the actual Unicode character … is the clear winner. It’s simple for translators to see and work with, and it aligns with WordPress core practices.


    What About Escaping?

    A common concern is whether esc_html() or similar escaping functions will handle the ellipsis character correctly.

    Good news: esc_html() passes the ellipsis character through unchanged because it’s not a character that needs escaping for HTML. It’s completely safe.

    However, if you use the HTML entity … inside a translatable string and then apply esc_html(), you might end up with literal … displayed to users if the string is double-escaped or used in certain contexts.


    Summary: The Bottom Line

    PracticeVerdict
    __( 'Loading...' )❌ Avoid—three dots are a typographic compromise
    __( 'Loading…' )⚠️ Risky—may break with escaping or in certain contexts
    __( 'Loading…' )✅ Best practice—clean, translatable, and core-approved

    References for Further Reading


    Final Word

    Using the proper ellipsis character … in your WordPress translatable strings isn’t just about looking professional—it’s about following core conventions, respecting translators, and writing more robust code.

    The WordPress core team has done the heavy lifting of standardizing this practice. All that’s left is for you to adopt it.

    Next time you type ... in a translatable string, stop and use … instead. Your users—and your translators—will thank you.


    Have thoughts on this? Drop a comment below or reach out on Twitter. And if you found this helpful, consider sharing it with your fellow WordPress developers.

  • Code as Context for l10n

    Why WordPress Demands “مخطّط المستند” Over Legacy Translations

    In software localization, a string in isolation is a trap. When translating a massive platform like WordPress, looking at a spreadsheet of isolated English phrases often leads to “safe” but clunky translations. The ultimate source of truth is never the glossary—it is the source code.

    For years, the Arabic localization for “Document Outline” has been ملخص عناوين المستند (literally: Summary of document headings). Born from an era where translators felt the need to heavily explain UI features to users (a process called explicitation), this string is wordy, descriptive, and ultimately outdated.

    As we look toward modern WordPress UI paradigms, it is time to standardize this string to مخطّط المستند. To understand exactly why this update is necessary, we don’t need to debate linguistics—we just need to look at the code.

    The Reference Code: A Window into the UI

    Let’s examine the exact file where this string lives in the Gutenberg block editor: wp-includes/js/dist/editor.js, specifically within the TableOfContentsPanel component.

    Here is the structural blueprint of that panel:

    JavaScript

    // ... [Lines 49560 - 49617 omitted for brevity] ...
    <div className="table-of-contents__wrapper" role="note" aria-label={__("Document Statistics")}>
        {/* Renders Counts: Words, Characters, Time to read, Headings, Paragraphs, Blocks */}
    </div>
    
    { headingCount > 0 && (
        <>
            <hr />
            <h2 className="table-of-contents__title">{__("Document Outline")}</h2>
            <DocumentOutline
                onSelect={onRequestClose}
                hasOutlineItemsDisabled={hasOutlineItemsDisabled}
            />
        </>
    )}
    // ... [Line 49630] ...
    

    By reading this snippet, the context transforms the way we must approach the translation. Here is how the reference code guides us to a vastly superior Arabic localization.

    1. The Code Proves It’s a Structure, Not a “Summary”

    Look at the logic in the code. The panel is divided into two distinct sections. The top half is strictly for Document Statistics (Words, Characters, reading time). This top section acts as the actual summary of the document’s contents.

    Below the <hr /> (horizontal rule), we see the Document Outline. If we keep the legacy translation ملخص عناوين المستند (Summary of headings), we create a semantic clash. We are placing a “summary” directly underneath actual statistical summaries.

    The <DocumentOutline/> component rendered here is a navigational tree—a structural skeleton that lets users jump between header blocks. مخطّط means “plan,” “map,” or “outline.” By using مخطّط المستند, we accurately tell the user they are looking at a structural map, differentiating it cleanly from the statistics above it.

    2. The Original File Path Reveals Architectural Intent While the bundled distribution code lives in editor.js, line 49560 provides a crucial breadcrumb to the original, uncompiled source code: // packages/editor/build-module/components/table-of-contents/panel.mjs.

    This file path is a L10n goldmine. It explicitly identifies that this UI element belongs to the table-of-contents component. A Table of Contents is inherently a navigational map of a document’s hierarchy; it is never a summary of the text itself. By organizing the code under table-of-contents, the core engineering team is signaling clear structural intent.

    Translating this feature as a ملخص (summary) directly contradicts the architectural blueprint of the software. Conversely, مخطّط (outline/map) perfectly echoes the navigational purpose of a Table of Contents, ensuring the Arabic string aligns with the foundational logic of the Gutenberg editor.

    3. The <h2> Tag Demands Brevity

    Notice the HTML element wrapping our string:

    <h2 className="table-of-contents__title">{__("Document Outline")}</h2>

    This string is not explanatory text; it is a section heading (<h2>). In UI design, headings must be punchy, scannable, and instantly recognizable.

    • Legacy: ملخص عناوين المستند (3 words, visually heavy)
    • Proposed: مخطّط المستند (2 words, crisp and standard)

    Users do not read software interfaces; they scan them. A three-word, overly descriptive heading slows down the user’s cognitive parsing. مخطّط المستند functions perfectly as a quick, scannable title.

    4. Spatial Constraints of the Sidebar Panel

    The component name is TableOfContentsPanel. In the WordPress editor, this panel is a narrow sidebar or a popover menu. UI real estate is highly restricted.

    When a multi-word string like ملخص عناوين المستند is crammed into a narrow sidebar, it risks truncation (e.g., ملخص عناوين ا...) or awkward line breaks, especially on mobile views. The source code reveals the physical constraints of the UI, proving that the shorter, more compact مخطّط المستند is a functional necessity to preserve the design layout.

    5. Aligning with Industry Standards

    As localization specialists, consistency across the digital ecosystem is one of our primary goals. When users switch between Microsoft Word, Google Docs, Apple Pages, and various web-based CMS platforms, they shouldn’t have to learn a new vocabulary for the exact same tool.

    Major tech giants have already recognized the need for concise, structural terminology:

    • Google Docs currently utilizes مخطّط المستند for its outline feature.
    • Microsoft Word uses similar structural terminology, like جزء التنقل (Navigation Pane) or مخطط المستند (Document Map in older versions).

    By updating to مخطّط المستند, we align our product with the established mental models of millions of Arab users. We stop forcing them to translate our unique legacy jargon and instead speak the language they already know.

    Conclusion: Translating for the Future

    WordPress is a constantly evolving ecosystem. With modern iterations of the block editor, the UI is becoming cleaner, faster, and more minimalist. Our Arabic localization must evolve with it.

    Relying on the source code changes a translator from a mere linguist into a UI/UX advocate. The code at editor.js:49618 explicitly tells us that “Document Outline” is a compact, structural heading housed within a narrow panel. By dropping the outdated, hand-holding explicitation, observing UI boundaries, and adopting the industry standard مخطّط المستند, we respect the developer’s design and ultimately provide a more native, professional experience for the Arab WordPress user.