mirror of
https://github.com/hydra-synth/hydra.git
synced 2025-12-23 15:19:59 +01:00
added rtl rendering arabic
This commit is contained in:
@@ -50543,7 +50543,7 @@ module.exports = function store(state, emitter) {
|
||||
// console.log('setting language to', lang)
|
||||
i18next.changeLanguage(lang, (err, t) => {
|
||||
// console.log(err, t)
|
||||
selectedLanguage = lang
|
||||
state.translation.selectedLanguage = lang
|
||||
emitter.emit('render')
|
||||
})
|
||||
})
|
||||
@@ -51437,9 +51437,11 @@ const toolbar = require('./toolbar.js')
|
||||
const link = (url) => `href=${url} target=_blank`
|
||||
module.exports = function mainView(state, emit) {
|
||||
const { t, languages } = state.translation
|
||||
const textDirection = state.translation.selectedLanguage === 'ar' && state.showInfo === true ? 'rtl': 'ltr'
|
||||
|
||||
const langArray = Object.entries(languages)
|
||||
return html`
|
||||
<div id="info-container" class="${state.showInfo ? "" : "hidden"}">
|
||||
<div id="info-container" class="${state.showInfo ? "" : "hidden"}" style="direction:${textDirection}">
|
||||
<div id="modal">
|
||||
<div id="modal-header" style="opacity:${state.showUI === true? 1: 0}">
|
||||
${state.showInfo && langArray.length > 1 ? html`<div style="display:flex">${langArray.map(([key, val]) => html`
|
||||
|
||||
@@ -108,6 +108,8 @@ transition: width 1s;
|
||||
|
||||
.language-select {
|
||||
margin: 8px;
|
||||
text-align: center;
|
||||
width: 3.8em;
|
||||
font-weight: 200;
|
||||
cursor: pointer;
|
||||
pointer-events: auto;
|
||||
|
||||
@@ -47,7 +47,7 @@ module.exports = function store(state, emitter) {
|
||||
// console.log('setting language to', lang)
|
||||
i18next.changeLanguage(lang, (err, t) => {
|
||||
// console.log(err, t)
|
||||
selectedLanguage = lang
|
||||
state.translation.selectedLanguage = lang
|
||||
emitter.emit('render')
|
||||
})
|
||||
})
|
||||
|
||||
@@ -5,9 +5,11 @@ const toolbar = require('./toolbar.js')
|
||||
const link = (url) => `href=${url} target=_blank`
|
||||
module.exports = function mainView(state, emit) {
|
||||
const { t, languages } = state.translation
|
||||
const textDirection = state.translation.selectedLanguage === 'ar' && state.showInfo === true ? 'rtl': 'ltr'
|
||||
|
||||
const langArray = Object.entries(languages)
|
||||
return html`
|
||||
<div id="info-container" class="${state.showInfo ? "" : "hidden"}">
|
||||
<div id="info-container" class="${state.showInfo ? "" : "hidden"}" style="direction:${textDirection}">
|
||||
<div id="modal">
|
||||
<div id="modal-header" style="opacity:${state.showUI === true? 1: 0}">
|
||||
${state.showInfo && langArray.length > 1 ? html`<div style="display:flex">${langArray.map(([key, val]) => html`
|
||||
|
||||
Reference in New Issue
Block a user