Identify what changes language on the page
An Arabic passage is added to a French page about a fictional workshop. The sentence means the workshop starts at 10:30. After pasting into a Custom HTML block, the Arabic letters are visible on screen. Yet the passage has no language of its own and inherits the page's direction. In another version of the suggestion, lang="ar" is present but dir="ltr" still imposes left-to-right direction. These two states require different corrections.
Start by rereading the page around the passage. The title, introduction, menu and following instructions are in French. The general language belongs to the html tag rendered by WordPress and its theme. Keep French as this document's reference language. In the added passage, specify the sentence's actual language and the direction appropriate to its script. Language describes the text. Base direction controls how the browser arranges characters, numbers and surrounding punctuation.
Record what you expect before changing the block. The page stays French and left-to-right. The Arabic sentence must be identifiable as Arabic and read within a passage whose base direction is right-to-left. The two neighboring French sentences retain their original behavior. Also check the number 10:30 after saving. The work concerns attributes and their scope. It requires neither retranslating the sentence nor changing the site's overall language.
Keep a control before saving the pasted content
Work on a copy of a post or page. Write a French introductory sentence, a quotation about the time and another French sentence after the quotation. The two sentences around the block serve as controls. In the reference state, the quotation is French. Save the revision or exact block body, then open the copy's page as a visitor. Record the text in all three areas and the main tag's language. If the page already declares the wrong language, record that problem separately. Testing one passage cannot settle configuration for every page.
To represent the suggestion without a service, replace the French quotation with the demonstration Arabic sentence in a Custom HTML block. Keep a first version where the quotation has neither language nor direction. Prepare a second version where it has lang="ar" and dir="ltr". Keep the same Arabic text in both versions. This lets you attribute observed differences to the attributes instead of a different wording or number.
If you start with a real suggestion, first check its text and markup before pasting. A content fragment belongs in the page body. If the suggestion includes a document wrapper with html, head or body, keep only the useful fragment. For a fully translated page, the main language belongs to the rendered page and its configuration. In this staging exercise, only one quotation changes language. Its declaration must therefore be limited to that quotation.
Keep variants separate in your working notes. The reference block allows a quick rollback if a pasting error also affects another passage. To find the correct location after saving, note the first French words before the quotation and those following it. You can also keep a test identifier on the copy. In content with several quotations, record the precise location instead of searching for the first element of the same type in the document.
Distinguish inherited language from inherited direction
In the DOM, a language declared on an element also applies to descendants without their own declaration. A quotation without lang can therefore inherit the page's French language even if its text contains Arabic characters. The browser can display those characters. Their presence does not demonstrate that the passage is identified as Arabic. In the control's first state, inspection finds French as the effective language because the nearest declaration is on the page.
To specify Arabic, lang="ar" is sufficient in this exercise. This code alone does not impose a base direction on the block. In the second state, the browser recognizes the quotation as Arabic while its direction remains left-to-right because dir="ltr" is still written on the quotation. Recording these values separately helps explain why a first correction may seem complete when it is not.
Direction concerns how text is arranged. A right-to-left sentence may contain numbers, a time or a name in another script. Avoid manually reversing character order or moving punctuation to compensate for an incorrectly declared container. First correct the passage's base direction, then reread the sentence and time on screen. Right alignment controls position on the line. It does not, by itself, provide the expected reading direction.
Choose the element that covers exactly the passage. For a wholly Arabic quotation, the quotation container is appropriate. For a few words in a French sentence, mark only the relevant segment. An isolated proper name or a term already used in the text's language does not necessarily require a separate declaration. If the passage's language or meaning is uncertain, have the text checked before choosing attributes. An accurate declaration must describe what readers actually receive.
Correct the fragment in the block that produces it
On the copy, open the Custom HTML block and find the quotation. Add or correct lang="ar" and dir="rtl" on its container. Keep both French sentences outside that container. In the following fragment, the sentence means the workshop starts at 10:30. The attributes describe the entire quotation and apply to its child paragraph.
The correction is limited to attributes describing language and direction. Reread the text before saving to avoid changing the time through another paste. If the suggestion used a CSS direction or alignment rule, inspect its scope. HTML markup is the starting point for base direction. A presentation rule may still produce a different computed direction depending on the theme. You must then check the rule applying to this passage.
If the block comes from a template or reused pattern, check where its text is stored. Changing the shared source may affect several pages. The staging exercise uses a block local to a single post to limit that scope. On a copy of your site, locate another occurrence of the source if you need to change a shared element. You can then confirm that pages without the quotation retain their initial behavior.
<blockquote lang="ar" dir="rtl">
<p>تبدأ الورشة عند الساعة 10:30.</p>
</blockquote>Check the page DOM after saving
Save the copy, close the previous preview and reopen the post address. Inspect the quotation in the browser's Elements panel. First check that the html tag still declares French. Then check that the attributes are on the quotation in the document actually rendered. They must apply to the Arabic paragraph and stop before the next sentence. A declaration at the wrong level may give the correct result for the quotation while changing another block's behavior.
Compare the block code with the DOM. If lang or dir was in the pasted content but is missing from the DOM, check what was retained when you reopen the block. If the attribute has already disappeared from the saved block, there is a difference between pasting and saving. If the block retained it, examine the component producing the page and the browser's HTML parsing result. In either case, record the difference before changing a global setting or your account's permissions.
In the quotation's computed styles, look for the direction property. With the corrected staging fragment, its value is rtl. In the following French sentence, it remains ltr. If the DOM contains dir="rtl" but computed direction is still ltr, look for a rule applied to that element or its descendant. Also record the nearest declared language for each paragraph. The Styles panel does not replace this attribute record. It answers a different question about what the browser applies to the display.
Reread the Arabic sentence and number in context. The test compares DOM text with the starting text, including 10:30. This comparison helps identify a content change during pasting. It does not, by itself, assess each character's visual position. If the passage contains several scripts, inspect the display with the site's normal styles and have someone who knows the language review it.
Read the results and state the test's limits
Compare five states on your copy: reference, paste without attributes, paste with only the language correctly declared but the wrong direction, complete correction and restoration. The main tag must retain French; both French sentences must retain their text and direction. For the quotation, record the nearest declared language and computed direction separately. No execution result for this comparison is provided here.
Save the variants in a Custom HTML block, then inspect the loaded page's DOM. This protocol checks whether attributes and text survive saving in your environment. Visual pasting may produce a different result; record the paste mode used. A test without styles or scripts can isolate attributes, but final validation must include the usual styles and interactions.
No screen reader was tested. The presence of lang="ar" provides language information that assistive technologies can use. It demonstrates neither a voice change, pronunciation of the text nor reading of the time. If your validation includes that experience, add a test with the screen reader and voice your team uses. Record the reading result separately from the DOM result.
Restore the reference and keep the check reusable
To undo the change on the copy, restore the revision containing the reference fragment. If other passages have been edited since, restore only the quotation and attributes recorded at the start. Then reopen the post in the browser. Check the main tag, quotation and both control sentences. Rollback may be incomplete if the text is restored but an added attribute remains on the container.
After restoration, compare the saved body and rendered fragment with your reference. If it contains a French quotation, that language must be restored. If it already contains a valid Arabic passage, restore its text and attributes instead of deleting every local declaration. Also check both neighboring sentences.
For review, provide the copy's address, the affected passage and expected values. Add observed attributes and computed direction in all three areas. Keep the suggestion as tested and the corrected version. The reviewer can then check that the time has not changed, the quotation is correctly declared and the rest of the page retains its intended language and direction.
Adapt the check to an expression inside a sentence
The passage may be limited to an English expression within a French paragraph. In that case, both texts follow the same direction. Mark the segment with its corresponding language, then reread the words before and after it. If the entire French sentence inherits English, the attribute is too high in the document. A local correction therefore also requires checking surrounding words, even when the line's direction shows no visible change.
Conversely, if the entire passage is a paragraph in a right-to-left script, assign direction to the paragraph or its dedicated container. The edge to which text aligns may remain a presentation choice of the theme. Check declared and computed direction before changing that alignment. In text where readers need to recognize a time or reference, request a review of the final rendering and keep the number itself in the record.
In both cases, open the block after saving and check exactly where the attribute was placed. If the suggestion adds several passages, choose a French control between two passages to check. This helps identify an overly broad container passing its attributes to everything that follows. Start with an isolated correction. Extend it to other passages once you have confirmed their language, direction and position in the DOM.
Inspect the nearest declaration without modifying the passage
In the browser inspector, select the Arabic paragraph precisely. In a DevTools console that exposes the selected element as $0, this record reads the nearest language declaration and computed direction.
Repeat with the following French paragraph. The expected result for the example is an ar declaration near the quotation and computed rtl direction, while the French control retains its language and ltr. An empty lang value differs from an absent attribute; this record shows the declaration found, not language detection of the text.
This free diagnostic translates nothing and does not validate pronunciation. A translation service cannot replace checking attribute scope. Correct the block source, reload and compare all three areas. To undo, restore the saved fragment; a change made only in the inspector disappears on reload and is not a correction saved in WordPress.
({
balise: $0.tagName,
langueDeclareeLaPlusProche: $0.closest('[lang]')?.getAttribute('lang') ?? null,
directionDeclareeLaPlusProche: $0.closest('[dir]')?.getAttribute('dir') ?? null,
directionCalculee: getComputedStyle($0).direction
});Sources and references
Use these references to check the features, requirements and limitations described. Reading documentation is not a practical test.


