Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Right to left support . #51

Closed
karamqubsi opened this issue Feb 27, 2017 · 8 comments
Closed

Right to left support . #51

karamqubsi opened this issue Feb 27, 2017 · 8 comments

Comments

@karamqubsi
Copy link
Contributor

Hi ,
Is it possible to implement right to left support for for Arabic , Hebrew , Persian languages . the current version looks not supporting that .

@NateWr
Copy link
Contributor

NateWr commented Feb 27, 2017

Hi @karamqubsi, RTL support would be great. Are you able to issue a PR with support for this?

@karamqubsi
Copy link
Contributor Author

Hi @NateWr , I will try to do that , thank you :) .

@karamqubsi
Copy link
Contributor Author

karamqubsi commented Mar 3, 2017

Hi @NateWr I did a small change that worked for me you might test it here (not sure if it can be suitable for a pull request ) :
https://github.com/karamqubsi/bootstrap3

I'm not familiar with the ojs code base so maybe there is a better way to do that and of course it might be better for some users not to use cdn library ...

anyway that fixed the problem for us , now we are using ojs3 bootstrap with rtl support ,

Thanks a lot for your efforts in these projects .

@NateWr
Copy link
Contributor

NateWr commented Mar 6, 2017

Hi @karamqubsi,

Thanks for your pr at #52. OJS3 actually has a config option for whether or not to enable the use of a CDN. This is important for some countries that have strict privacy laws, where people don't want the request to an external server.

Instead of modifying the template file, can you instead load it in via the addStyle theme method? To do this, add a copy of the .css file to to the styles directory, so it's at /plugins/themes/bootstrap3/styles/bootstrap-rtl.min.css. Then, in the BootstrapThreeThemePlugin.inc.php file, you'll see how styles and scripts are loaded here:

https://github.com/NateWr/bootstrap3/blob/master/BootstrapThreeThemePlugin.inc.php#L58

If you add the following code, this should load the RTL stylesheet if the locale is RTL, and it will load from the CDN if the enable_cdn config option is set:

$locale = AppLocale::getLocale();
if (AppLocale::getLocaleDirection($locale) === 'rtl') {
	if (Config::getVar('general', 'enable_cdn')) {
		$this->addStyle('bootstrap-rtl', '//cdn.rawgit.com/morteza/bootstrap-rtl/v3.3.4/dist/css/bootstrap-rtl.min.css');
	} else {
		$this->addStyle('bootstrap-rtl', 'styles/bootstrap-rtl.min.css');
	}
}

@karamqubsi
Copy link
Contributor Author

Hi , thanks for the help , I added a new commit to my branch please have a look , I added the code you've mentioned and I added the bootstrap-rtl.min.css to its place in the styles folder .

Thanks .

@NateWr
Copy link
Contributor

NateWr commented Mar 7, 2017

This is looking great @karamqubsi, thanks!

Can you just tweak the whitespace in your latest commit? The main block in BootstrapThreeThemePlugin.inc.php needs to be properly indentend, this commented line can be removed, and this line should be indented with tabs rather than spaces.

Then I think we'll be ready to go! 👍

@karamqubsi
Copy link
Contributor Author

Thanks @NateWr , I did the indentations and I removed the comment :) .

@NateWr
Copy link
Contributor

NateWr commented Mar 8, 2017

I've merged that PR now. Thanks for contributing!

@NateWr NateWr closed this as completed Mar 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants