Adding new twig methods to add locale switch paths in views or controller to construct a locale switch in templates

Use {% do add_locale_switch_path('en', 'a path to the localized content') %} to add a path to a localized content
Use {% for locale, path in get_locale_switch_paths() %} to loop on each localized path and generate a locale switch menu
Refactoring twig methods to remove deprecated methods added by Symfony 2.4