Skip to content

Instantly share code, notes, and snippets.

@bartrail
Created July 11, 2011 15:01
Show Gist options
  • Save bartrail/1076036 to your computer and use it in GitHub Desktop.
Save bartrail/1076036 to your computer and use it in GitHub Desktop.
{# MyBundle/Resources/view/JavaScript/localized.js.twig #}
<script type="text/javascript">
/**
* template for dynamic translations and urls for js
*/
var localize = {
inlineEdit: {
tooltip: '{{ "user.profile.edit.tooltip" | trans }}',
submit: '{{ "user.profile.edit.submit" | trans }}',
cancel: '{{ "user.profile.edit.cancel" | trans }}',
ajax: '{{ path('application_user_profile_ajax_update') }}'
},
ajax: {
profile: {
update: '{{ path('application_user_profile_ajax_update') }}'
}
},
dialog : {
address : {
buttons: {
submit: '{{ 'user.profile.vcard.dialog.save' | trans }}',
cancel: '{{ 'user.profile.vcard.dialog.cancel' | trans }}'
}
}
}
};
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment