PHPackages                             irmmr/flarum-ext-rtl - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Localization &amp; i18n](/categories/localization)
4. /
5. irmmr/flarum-ext-rtl

ActiveFlarum-extension[Localization &amp; i18n](/categories/localization)

irmmr/flarum-ext-rtl
====================

Right-to-Left (rtl) direction support for "Flarum" core and extensions.

v1.0.2(1mo ago)22.1kMITPHP

Since Dec 10Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/irmmr/flarum-ext-rtl)[ Packagist](https://packagist.org/packages/irmmr/flarum-ext-rtl)[ RSS](/packages/irmmr-flarum-ext-rtl/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (8)Versions (29)Used By (0)

 [ ![](https://camo.githubusercontent.com/5748259b63cb66b98fa65bb0003aff416a97800e52232517ea360ce4a6fe4e11/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f69726d6d722f666c6172756d2d6578742d72746c3f7374796c653d666c61742d737175617265) ](https://packagist.org/packages/irmmr/flarum-ext-rtl) [ ![](https://camo.githubusercontent.com/de12014d91090efb6710bcf6ef80bf31e656fcf290bda33a5d839124962432ca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f666c6172756d253246636f72652d25354576322e302e304072632e312d626c75653f7374796c653d666c61742d737175617265) ](https://github.com/flarum/core) [![](https://camo.githubusercontent.com/652e18ee18a21ca35e3958903403bf7bb16d665973a4ab2fcc0b07e928bff4ac/68747470733a2f2f692e706f7374696d672e63632f30796663713733742f53637265656e73686f742d323032342d31312d31382d61742d31322d33382d35302d466c6172756d2d436f6d6d756e6974792e706e67)](https://camo.githubusercontent.com/652e18ee18a21ca35e3958903403bf7bb16d665973a4ab2fcc0b07e928bff4ac/68747470733a2f2f692e706f7374696d672e63632f30796663713733742f53637265656e73686f742d323032342d31312d31382d61742d31322d33382d35302d466c6172756d2d436f6d6d756e6974792e706e67)

---

### Flarum RTL extension

[](#flarum-rtl-extension)

This extension is for adding RTL support to Flarum. Unlike previous versions, you no longer need to write additional `LESS/CSS` for your forum.

This extension tries to change the directions from `LTR` to `RTL` as much as possible. This project focuses on the Flarum core user interface and other known extensions.

### Install

[](#install)

Installation is like all flarum extensions.

```
composer require irmmr/flarum-ext-rtl

```

You can also use the latest changes.

```
composer require irmmr/flarum-ext-rtl:dev-main

```

### Update

[](#update)

```
composer update irmmr/flarum-ext-rtl

```

This plugin adds an RTL version alongside all compiled CSS files. While using this method has many advantages, it can also come with some issues. If you encounter a serious problem while using this plugin, you can visit the `issue` section.

### Commands

[](#commands)

With a series of commands, you can control the generated codes for RTL (right-to-left). Essentially, each selector accepts a set of commands. Due to the lack of support for all types of comments in "sabberworm/php-css-parser," it is not possible to use commands as before.

Please see `rtl-css`

### Asset Mapping Rules

[](#asset-mapping-rules)

Asset Mapping Rules let you control how original `LTR` assets are converted to their `RTL` versions. This is useful when file names do not follow a simple convention, when assets come from a CDN, or when you want to manually define which `CSS` or `JS` file should be replaced.

Each rule contains:

- a **Pattern**
- a **Replace**
- a **Type** (`Auto`, `CSS`, or `JS`)

#### How it works

[](#how-it-works)

When the extension processes an asset, it checks the defined rules **from top to bottom**.
The **first matching rule wins** and its replacement is used to build the RTL asset path.

This means:

- more specific rules should be placed **before** general ones
- exact file matches should usually come before wildcard rules like `*.css`
- once a rule matches, the remaining rules are ignored for that asset

#### Supported behavior

[](#supported-behavior)

- **Wildcard matching** using `*`
- Matching against:
    - just the filename/path
    - or the full asset URL
- Type filtering:
    - `Auto` → applies regardless of file type
    - `CSS` → applies only to CSS assets
    - `JS` → applies only to JavaScript assets
- Preservation of the original:
    - query string, such as `?v=123`
    - fragment, such as `#theme`

If the replacement value is a full absolute URL, the extension uses it directly.

#### Configuration

[](#configuration)

You can define Asset Mapping Rules from the admin panel:

`Admin → Extensions → RTL → Asset Mapping Rules`

Each rule has the following fields:

##### Pattern

[](#pattern)

The original asset path or URL to match.

Examples:

- `*.css`
- `assets/vendor/*.js`
- `https://cdn.example.com/*.min.css`

##### Replace

[](#replace)

The RTL version that should replace the matched asset.

Examples:

- `*.rtl.css`
- `rtl-*.js`
- `https://cdn.example.com/rtl/*.min.css`

##### Type

[](#type)

Controls which assets the rule applies to:

- `Auto`
- `CSS`
- `JS`

#### Examples

[](#examples)

##### 1. Add `.rtl` before `.css`

[](#1-add-rtl-before-css)

If you want all CSS files to be replaced with an RTL version:

- **Pattern:** `*.css`
- **Replace:** `*.rtl.css`
- **Type:** `CSS`

Example:

- `forum.css` → `forum.rtl.css`

##### 2. Replace a specific CDN stylesheet

[](#2-replace-a-specific-cdn-stylesheet)

If a library provides a separate RTL file on a CDN:

- **Pattern:** `https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.0/css/bootstrap.min.css`
- **Replace:** `https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.0/css/bootstrap.rtl.min.css`
- **Type:** `CSS`

##### 3. Rewrite JavaScript asset names

[](#3-rewrite-javascript-asset-names)

If your build process creates mirrored JS file names:

- **Pattern:** `assets/*.js`
- **Replace:** `assets/rtl-*.js`
- **Type:** `JS`

Example:

- `assets/app.js` → `assets/rtl-app.js`

##### 4. Use a generic rule for mixed assets

[](#4-use-a-generic-rule-for-mixed-assets)

If you want a rule to apply regardless of extension:

- **Pattern:** `theme-*`
- **Replace:** `rtl-theme-*`
- **Type:** `Auto`

#### Important notes

[](#important-notes)

- Rules are processed in order, and **the first match wins**
- Put **specific rules before generic rules**
- After changing rules, you should **clear the Flarum cache**
- These rules affect how payload assets and mapped RTL resources are resolved
- Incorrect patterns may prevent the correct RTL asset from loading

Note

**Important behavior when using the `rtlcss` driver**

If the RTL driver is set to `rtlcss`, asset mapping rules are only used when a compiled RTL version of the requested file is **not already available**.
If the extension can already resolve and return the compiled RTL asset directly, that compiled file will be used first and the mapping rules will not override it.

In other words:

- if a compiled RTL version exists, it is returned directly
- if no compiled RTL version exists, the extension tries the asset mapping rules

Also, be careful when creating mapping rules for Flarum’s core JavaScript files.
If you are not fully sure what you are doing, it is strongly recommended **not** to add rules for core `JS` assets. A wrong rule may make the admin panel fail to load because the required JavaScript files can no longer be resolved correctly.

###  Health Score

49

—

FairBetter than 94% of packages

Maintenance90

Actively maintained with recent releases

Popularity22

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 57.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~60 days

Recently: every ~134 days

Total

28

Last Release

50d ago

Major Versions

V0.2.5 → v1.0.02026-05-06

### Community

Maintainers

![](https://www.gravatar.com/avatar/523cf016e8f0fdcee80e35fdca4467d6257e309db7f3eb5bc7b5eb9fba029244?d=identicon)[irmmr](/maintainers/irmmr)

---

Top Contributors

[![irmmr](https://avatars.githubusercontent.com/u/52796853?v=4)](https://github.com/irmmr "irmmr (82 commits)")[![marmar8x](https://avatars.githubusercontent.com/u/177212675?v=4)](https://github.com/marmar8x "marmar8x (52 commits)")[![SKevo18](https://avatars.githubusercontent.com/u/39010496?v=4)](https://github.com/SKevo18 "SKevo18 (8 commits)")

---

Tags

flarumflarum-extflarum-extensionflarum-rtlflarumrtlflarum-extflarum-rtl

### Embed Badge

![Health badge](/badges/irmmr-flarum-ext-rtl/health.svg)

```
[![Health](https://phpackages.com/badges/irmmr-flarum-ext-rtl/health.svg)](https://phpackages.com/packages/irmmr-flarum-ext-rtl)
```

###  Alternatives

[flarum-lang/russian

Russian language pack for Flarum.

12128.3k](/packages/flarum-lang-russian)[flarum-lang/french

French language pack to localize the Flarum forum software plus its official and third-party extensions.

1938.7k](/packages/flarum-lang-french)[chameleon-system/chameleon-base

The Chameleon System core.

1028.6k5](/packages/chameleon-system-chameleon-base)[flarum-lang/german

German language pack for Flarum.

2252.7k](/packages/flarum-lang-german)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
