mirror of
https://github.com/ankitects/anki.git
synced 2026-07-22 03:17:05 -04:00
## Linked issue Closes #5004 ## Summary This adds intro entries for languages that have manual translations listed under https://docs.ankiweb.net/#translations Only placeholder pages with links to the contributor websites for now. ## How to test Run `mint dev` under docs-site and try switching the language from the top left.
31 lines
805 B
JavaScript
31 lines
805 B
JavaScript
(function () {
|
|
var RTL_LANGS = ['ar', 'fa', 'he', 'ug', 'yi'];
|
|
|
|
function applyDirection() {
|
|
var lang = window.location.pathname.split('/')[1];
|
|
if (RTL_LANGS.indexOf(lang) !== -1) {
|
|
document.documentElement.classList.add('is-rtl');
|
|
} else {
|
|
document.documentElement.classList.remove('is-rtl');
|
|
}
|
|
}
|
|
|
|
applyDirection();
|
|
|
|
// Handle browser back/forward navigation in the SPA
|
|
window.addEventListener('popstate', applyDirection);
|
|
|
|
// Intercept pushState/replaceState for client-side routing
|
|
var _push = history.pushState;
|
|
history.pushState = function () {
|
|
_push.apply(this, arguments);
|
|
applyDirection();
|
|
};
|
|
|
|
var _replace = history.replaceState;
|
|
history.replaceState = function () {
|
|
_replace.apply(this, arguments);
|
|
applyDirection();
|
|
};
|
|
})();
|