Solved. Dynamic Language/Style Adaptation in the Item Pane Header

edited 6 days ago
Hi everyone,

I originally posted this asking for a Language-to-Style mapping feature in Zotero's preferences to handle bilingual (Latin/Arabic) databases. Since I cannot delete the post, I am updating it because I actually managed to solve this entirely within the CSL code itself!

I realized that a UI feature request is unnecessary if the CSL style is truly dynamic. By using the condition to separate the macros, I built a single, unified style that adapts automatically based on the Zotero Language field:

If Language = ara (or ar): The CSL logic switches to RTL-friendly formatting, replaces italics with bold, swaps Latin commas for Arabic commas (،), and uses Arabic localized terms.

If Language = fre or eng (or else/empty): It falls back to standard Western formatting (italics, Latin punctuation, French/English terms).

This completely eliminates the workflow friction. The Item Pane Header now perfectly previews the item in its correct script and typography just by reading the language field, all from within a single CSL style.

As mentioned, I will submit this bilingual Arabic/Latin CSL style to the official repository soon to help others facing the same RTL/LTR challenges.

Thanks!

(Original post below for context)


Hi everyone,

I recently developed a custom CSL style for Arabic to solve long-standing RTL issues, Arabic punctuation, and localized terms. I plan to submit it to the official CSL repository soon, once final tests are complete.

While working with bilingual databases (Latin/Arabic), I hit a major workflow friction: I constantly need to check how an item renders in a specific Arabic style versus a standard Western style to ensure data is entered correctly for both outputs.

Currently in the General Preferences, even for standard multilingual styles like Chicago, Zotero forces us to choose a single, global "Header language" and a single "Header citation style".

Could we introduce a Language-to-Style Mapping in the Preferences?

Instead of a single global dropdown, users could define display rules based on the item's Language field. For example:

If Language = "ara" apply Style X

If Language = "fre" apply Style Y

If Language = "eng" apply Style Z

and so on...

(With a fallback to the global default style if the language field is empty or unmapped).

When selecting an item, the Item Pane Header would simply read the Language field and dynamically display the preview using the mapped CSL style.

This would be a massive time-saver for anyone dealing with multi-script or multilingual bibliographies (Arabic, Hebrew, CJK, etc.), allowing us to instantly verify our data entry without constantly tweaking the global preferences.

Thanks for your time and for the great work on Zotero !
Sign In or Register to comment.