Contextualize capitalization in locator

Unless I am mistaken (cf. for example https://ellii.com/blog/the-capitalization-of-certain-terms-exercise-page-chapter-unit-paragraph-line for a confirmation), terms like "Chapter" or "Figure" are supposed to be displayed with a "capitalize first" letter, but page references are supposed to stay lowercase (e.g., "p. 123").

It seems that I have to pick between

text-case="capitalize-first"

(correct for "Chapter", "Figure", incorrect for "p.") and

text-case="lowercase"

(incorrect for "Chapter", "Figure", correct for "p.") when tweaking how my locators are displayed. Is there any way of setting a rule for text-case that depends on the locator itself?
  • edited 2 days ago

    <choose>
    <if locator="page">
    <label variable="locator" form="short"/>
    </if>
    <else>
    <label variable="locator" text-case="capitalize-first"/>
    </else>
    </choose>


    Tweak as needed.
  • Excellent, thanks a lot.
Sign In or Register to comment.