Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions contentcuration/contentcuration/frontend/shared/i18n/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ const defaultLocale = defaultLanguage.id;

export const availableLanguages = {
[defaultLocale]: defaultLanguage,
ar: {
lang_name: 'Arabic',
lang_direction: languageDirections.RTL,
},
};

export let currentLanguage = defaultLocale;
Expand Down Expand Up @@ -180,9 +184,9 @@ function _setUpVueIntl() {
**/
const VueIntl = require('vue-intl');
Vue.use(VueIntl, { defaultLocale });
Vue.prototype.isRtl = languageDirection === 'rtl';
Vue.prototype.$isRtl = languageDirection === 'rtl';
Vue.prototype.$isRTL = languageDirection === 'rtl';
Vue.prototype.isRtl = languageDirection === languageDirections.RTL;
Vue.prototype.$isRtl = languageDirection === languageDirections.RTL;
Vue.prototype.$isRTL = languageDirection === languageDirections.RTL;

Vue.prototype.$tr = function $tr(messageId, args) {
const nameSpace = this.$options.name || this.$options.$trNameSpace;
Expand Down Expand Up @@ -225,6 +229,7 @@ export function i18nSetup(skipPolyfill = false) {

languageDirection = languageGlobals.languageDir || languageDirection;
*/
languageDirection = getLangDir(currentLanguage);

// Set up typography
setLanguageDensity(currentLanguage);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
viewBox="0 0 24 24"
:aria-label="kindTitle"
class="nothumbnail-image"
:class="$isRTL ? 'rtl-image' : 'ltr-image'"
>
<text
:x="-1"
Expand Down Expand Up @@ -199,6 +200,7 @@
left: 0;
width: 100%;
height: 100%;
overflow: hidden; // Don't show alt text outside of img boundaries

.caption + & {
height: calc(100% - @caption-height);
Expand Down Expand Up @@ -230,11 +232,17 @@

svg.nothumbnail-image {
top: 0;
left: 50% - (@svg-width / 4);
width: @svg-width;
margin: 0 auto;
overflow: visible;

&.ltr-image {
left: 36%;
}
&.rtl-image {
right: 66%;
}

.caption + & {
top: calc((@caption-height / 2) + @svg-top);
}
Expand Down