Skip to content

RTL toggle is a chrome extension that detects and toggles the language direction ('rtl'/'ltr') of a site.

License

Notifications You must be signed in to change notification settings

arismag/rtl-toggle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rtl-toggle

A chrome extension that detects and toggles the language direction ('rtl'/'ltr') of a site.

When you are developing for websites and applications that support languages that are written from right to left it's really helpful to visualize and toggle the language direction in the browser independently from the actual language that is being used.

HOW IT WORKS

The extensions does two things: Detects and toggles the direction of the website's language.

Detection:

When a new tab is loaded a script is checking the dir attribute of the <html> tag element. If the attribute is set to 'rtl', the extension's badge text is also set to "RTL" indicating that the current website uses a language that is written from right to left.

Toggling:

When the user clicks the extension's icon, a script toggles (or adds it if not set) the value of dir attribute of the <html> tag to one of the two values 'rtl'/'ltr'.

Icon states

LTR RTL
Selection_933 Selection_932

HOW TO INSTALL EXTENSION

The extension can be installed via chrome webstore or locally.

Chrome webstore

  1. Install via chrome webstore.

Local installation

  1. Download the extension and store it locally.
  2. Open chrome://extensions/ in your Chrome browser.
  3. Check developer mode.
  4. Click load unpacked extension.
  5. Select the directory of the extension.
  6. Enable and pin rtl-toggle as you would do with any other extension.

HOW TO USE

  1. Make sure the extension is enabled and pinned.
  2. Just click on the extension's icon ;).

SCREENSHOTS

Toggled on/Detection Toggled off
Selection_927 Selection_926
Selection_925

TODO

  • Some sites set the dir attribute on the <body> tag, so a condition should also be added for this case.

About

RTL toggle is a chrome extension that detects and toggles the language direction ('rtl'/'ltr') of a site.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published