Coder Social home page Coder Social logo

Right to left support . about bootstrap3 HOT 8 CLOSED

pkp avatar pkp commented on August 15, 2024
Right to left support .

from bootstrap3.

Comments (8)

NateWr avatar NateWr commented on August 15, 2024 1

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');
	}
}

from bootstrap3.

NateWr avatar NateWr commented on August 15, 2024

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

from bootstrap3.

karamqubsi avatar karamqubsi commented on August 15, 2024

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

from bootstrap3.

karamqubsi avatar karamqubsi commented on August 15, 2024

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 .

from bootstrap3.

karamqubsi avatar karamqubsi commented on August 15, 2024

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 .

from bootstrap3.

NateWr avatar NateWr commented on August 15, 2024

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! 👍

from bootstrap3.

karamqubsi avatar karamqubsi commented on August 15, 2024

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

from bootstrap3.

NateWr avatar NateWr commented on August 15, 2024

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

from bootstrap3.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.