Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Config Django :
- STATICI18N_ROOT = join(SITE_ROOT, 'my', 'internal', 'path')
- STATICFILES_DIRS += (STATICI18N_ROOT,)
- // config Require.js
- require.config({
- baseUrl: "static/js",
- paths: {
- "jsi18n": "../jsi18n/{{ LANGUAGE_CODE }}/djangojs",
- },
- shim: {
- "jsi18n":
- {
- exports: 'django'
- },
- }
- }
- # Usage
- require(["jquery", "jsi18n"], function($, jsi18n) {
- console.log(jsi18n.gettext('Internationalization is fun !'));
- // > "L’internationalisation, c'est cool !"
- }
Advertisement
Add Comment
Please, Sign In to add comment