ewjoachim

Untitled

Nov 26th, 2013
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. # Config Django :
  2. STATICI18N_ROOT = join(SITE_ROOT, 'my', 'internal', 'path')
  3.  
  4. STATICFILES_DIRS += (STATICI18N_ROOT,)
  5.  
  6. // config Require.js
  7. require.config({
  8. baseUrl: "static/js",
  9. paths: {
  10. "jsi18n": "../jsi18n/{{ LANGUAGE_CODE }}/djangojs",
  11. },
  12. shim: {
  13. "jsi18n":
  14. {
  15. exports: 'django'
  16. },
  17. }
  18. }
  19.  
  20. # Usage
  21. require(["jquery", "jsi18n"], function($, jsi18n) {
  22. console.log(jsi18n.gettext('Internationalization is fun !'));
  23. // > "L’internationalisation, c'est cool !"
  24. }
Advertisement
Add Comment
Please, Sign In to add comment