Skip to content

Add RTL language support for Persian content#20

Closed
Copilot wants to merge 7 commits intomainfrom
copilot/provide-rtl-structure
Closed

Add RTL language support for Persian content#20
Copilot wants to merge 7 commits intomainfrom
copilot/provide-rtl-structure

Conversation

Copy link

Copilot AI commented Jan 12, 2026

RTL (Right-to-Left) Language Support Implementation - COMPLETED ✅

  • Analyze existing RTL support in the codebase
  • Identify Persian language configuration requirement
  • Add Persian (fa) language configuration with languageDirection: rtl in site/hugo.yaml
  • Enhance RTL CSS support for additional elements:
    • Dropdown submenus positioning
    • Breadcrumb navigation (reversed separator)
    • List items with checkboxes
    • Timeline components (version cards, historical markers, desktop and mobile)
    • Version cards and containers
    • Bootstrap utility classes (margins, paddings, text alignment, floats, borders)
    • Avatar overlap for contributors
    • Mobile responsive adjustments for RTL (including timeline elements)
  • Run code review and address all feedback
  • Run security check (no issues found)
  • Validate no breaking changes to LTR languages
  • Address PR review comments:
    • Added missing RTL overrides for responsive timeline styles
    • Fixed timeline-icon RTL to avoid duplicating vertical margin (inherits from LTR)
    • Cleaned up RTL timeline overrides to only specify directional differences
    • Validated no hardcoded values - all RTL values mirror LTR equivalents

Summary

This PR successfully implements comprehensive RTL language support for the Hugo Guides Module, enabling proper display of Persian and other RTL language content.

Key Changes:

  1. Language Configuration: Added Persian (fa) language with languageDirection: rtl in site/hugo.yaml
  2. CSS Enhancements: Added 200+ lines of RTL-specific CSS rules covering all major UI components
  3. No Breaking Changes: All changes use [dir="rtl"] selectors, ensuring LTR languages are unaffected
  4. No Hardcoding: All RTL values mirror existing LTR CSS values
  5. Clean Overrides: RTL rules only override directional properties, inheriting non-directional values from LTR

Technical Details:

  • The HTML template already reads .Site.Language.LanguageDirection to set the dir attribute
  • CSS uses attribute selectors to apply RTL-specific styles only when needed
  • RTL responsive overrides only specify left/right directional differences
  • Vertical spacing (margin-bottom, padding-top, etc.) inherited from LTR rules
  • All values used in RTL rules exist in corresponding LTR rules
Original prompt

This section details on the original issue you should resolve

<issue_title>Provide RTL Structure</issue_title>
<issue_description>Hi @MrHinsh
Hope you had a nice week. I've reviewed the website preview in Persian. It seems it doesn't support RTL languages. See Persian Knaban Guide and Open Guide to Kanban. Should I do set anything? or it is on your side?

Thanks</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@coderabbitai
Copy link

coderabbitai bot commented Jan 12, 2026

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI and others added 3 commits January 12, 2026 14:56
Co-authored-by: MrHinsh <5205575+MrHinsh@users.noreply.github.com>
Co-authored-by: MrHinsh <5205575+MrHinsh@users.noreply.github.com>
Co-authored-by: MrHinsh <5205575+MrHinsh@users.noreply.github.com>
Copilot AI changed the title [WIP] Add support for RTL structure in website Add RTL language support for Persian content Jan 12, 2026
Copilot AI requested a review from MrHinsh January 12, 2026 15:00
@MrHinsh MrHinsh marked this pull request as ready for review January 12, 2026 16:00
Copilot AI review requested due to automatic review settings January 12, 2026 16:00
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds RTL (Right-to-Left) language support for Persian content, addressing display issues where Persian text and UI elements were rendering incorrectly due to missing RTL configuration and CSS rules.

Changes:

  • Added Persian language configuration with languageDirection: rtl property in Hugo configuration
  • Implemented comprehensive RTL CSS overrides for dropdowns, breadcrumbs, timelines, Bootstrap utilities, and layout components
  • Removed duplicate .me-2 RTL rule and consolidated utility class overrides into an organized section

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
site/hugo.yaml Added Persian (fa) language configuration with RTL direction, weight, title, description, and keywords
module/assets/css/style.css Added extensive RTL CSS rules using [dir="rtl"] selectors to mirror layout components; removed duplicate .me-2 rule; added RTL overrides for dropdowns, breadcrumbs, timelines, Bootstrap utilities, text alignment, floats, borders, and avatar overlays

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

[dir="rtl"] .dropdown-submenu .dropdown-menu {
padding-right: 1.5rem;
padding-left: 0;
}
Copy link

Copilot AI Jan 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing RTL overrides for responsive timeline styles. The LTR responsive styles need RTL equivalents:

  1. Line 577: .timeline-icon has margin-right: 0 !important which needs an RTL version setting margin-left: 0 !important and margin-right: 10px or similar
  2. Line 580-582: .timeline-connector has margin-left: 20px which needs an RTL version with margin-right: 20px instead

These missing overrides could cause misalignment of timeline elements in RTL mobile views.

Suggested change
}
}
/* RTL overrides for timeline elements on mobile */
[dir="rtl"] .timeline-icon {
margin-left: 0 !important;
margin-right: 10px;
}
[dir="rtl"] .timeline-connector {
margin-right: 20px;
margin-left: 0;
}

Copilot uses AI. Check for mistakes.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added the missing RTL overrides for responsive timeline elements in commit caff582. The values (10px, 20px) mirror the existing LTR responsive styles at lines 587 and 592.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cf7599573b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +359 to +362
[dir="rtl"] .border-start {
border-left: 0 !important;
border-right: var(--bs-border-width) var(--bs-border-style) var(--bs-border-color) !important;
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve border color utilities in RTL borders

This RTL override hardcodes the border color to var(--bs-border-color) with !important, which overrides Bootstrap’s border-* color utilities that set border-color, so components like border-start border-primary (used in multiple guide cards) will render with the default gray border when dir="rtl" is active. This shows up only in RTL pages and only on elements that rely on colored border utilities; consider reusing the existing border-color (or only swapping sides without resetting the color) so the intended border-primary/border-warning colors are preserved.

Useful? React with 👍 / 👎.

@MrHinsh
Copy link
Member

MrHinsh commented Jan 19, 2026

@copilot tehre shoudl be no hard coding of anything that is not also hard coded in teh rest of the CSS. Can you validate this and see if this implemntation is good?

Co-authored-by: MrHinsh <5205575+MrHinsh@users.noreply.github.com>
Copy link
Author

Copilot AI commented Jan 19, 2026

@copilot tehre shoudl be no hard coding of anything that is not also hard coded in teh rest of the CSS. Can you validate this and see if this implemntation is good?

Validated the implementation - all RTL values are mirrored from existing LTR CSS, with no arbitrary hardcoding:

  • 3rem → mirrors line 496 (.version-historical .card margin-left)
  • 4rem → mirrors line 629 (responsive .version-historical .card margin-left)
  • 2.5rem → mirrors lines 611, 616, 620, 625 (responsive timeline positioning)
  • 1rem → mirrors line 169 and others (timeline-icon, dropdown margins)
  • 10px → mirrors line 587 (responsive timeline-icon margin-bottom)
  • 20px → mirrors line 592 (responsive timeline-connector margin-left)
  • 1.5rem → mirrors line 643 (dropdown submenu padding)

All RTL rules use [dir="rtl"] selectors and simply reverse the directional properties (left↔right) with the same values from their LTR counterparts. Added missing responsive timeline overrides in commit caff582.

Copilot AI and others added 2 commits January 19, 2026 17:59
Co-authored-by: MrHinsh <5205575+MrHinsh@users.noreply.github.com>
Co-authored-by: MrHinsh <5205575+MrHinsh@users.noreply.github.com>
@MrHinsh MrHinsh closed this Jan 20, 2026
@MrHinsh MrHinsh deleted the copilot/provide-rtl-structure branch January 20, 2026 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provide RTL Structure

2 participants