Skip to content

Latest commit

 

History

History
40 lines (34 loc) · 905 Bytes

README.md

File metadata and controls

40 lines (34 loc) · 905 Bytes

Modify the following files on your Symfony project to enable this bundle:

  1. in app/AppKernel.php
class AppKernel extends Kernel
{
	public function registerBundles(){
		$bundles = array(
			new StrSocial\Bundle\LocalizationBundle\StrSocialLocalizationBundle(),
		);
	}
}
  1. app/config/routing.yml
	str_social_localization_bundle:
		resource: "@StrSocialLocalizationBundle/Controller/"
		type:     annotation
		prefix:   /
  1. add l10n js scripts to your twig
{% javascripts
    '@StrSocialLocalizationBundle/Resources/public/js/vendor/*'
    '@StrSocialLocalizationBundle/Resources/public/js/*'
%}
    <script type="text/javascript" src="{{ asset_url }}"></script>
{% endjavascripts %}
  1. to easily activate the feature from the frontend, add this to your js script
$(document).ready(function(){
	StrSocialL10n.fn.postTimeZoneAndReloadPageIfNeeded();
});