Skip to content
This repository has been archived by the owner on Jun 5, 2023. It is now read-only.

With these updates, RTL support is also available for locales. #89

Merged
merged 1 commit into from
Dec 14, 2020
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
9 changes: 8 additions & 1 deletion packages/stateofjs/lib/modules/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ export const locales = [
label: 'Español',
translators: ['timbergus', 'ezakto'],
},
{
id: 'fa-IR',
label: 'فارسی',
rtl: true,
translators: ['fghamsary'],
},
{
id: 'fr-FR',
label: 'Français',
Expand Down Expand Up @@ -96,11 +102,12 @@ export const locales = [
// };

locales.forEach((locale) => {
const { id, stringFiles, label } = locale;
const { id, stringFiles, label, rtl } = locale;
registerLocale({
id,
label,
dynamic: true,
rtl,
});

// if (id === 'en') {
Expand Down
2 changes: 1 addition & 1 deletion packages/stateofjs/lib/stylesheets/_bootstrap.scss

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions packages/stateofjs/lib/stylesheets/_global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

html {
box-sizing: border-box;
--text-start-directoin: left;
}
*,
*:before,
Expand Down
10 changes: 10 additions & 0 deletions packages/stateofjs/lib/stylesheets/_rtl_support.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
html.rtl {
direction: rtl;
--text-start-directoin: right !important;

.survey-section {
.form-check-input {
margin: 0px 0 0 $spacing/1.5 !important;
}
}
}
1 change: 1 addition & 0 deletions packages/stateofjs/lib/stylesheets/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@
@import '_accounts.scss';
@import '_score.scss';
@import '_admin.scss';
@import '_rtl_support.scss';