diff --git a/.gitignore b/.gitignore index 6087d632e..1e3a56c2d 100644 --- a/.gitignore +++ b/.gitignore @@ -11,4 +11,6 @@ codekit-config.json config.rb -deploy.sh \ No newline at end of file +deploy.sh + +.idea \ No newline at end of file diff --git a/client/main.js b/client/main.js index 2f11d40b8..8913b437b 100644 --- a/client/main.js +++ b/client/main.js @@ -9,6 +9,20 @@ Meteor.subscribe('settings', function(){ // runs once on site load analyticsInit(); Session.set('settingsLoaded',true); + + // Localisation + i18n.init({ + lng: getSetting("language"), + resStore: eval(getSetting("language")), + saveMissing: true, + debug: true + }); + + Handlebars.registerHelper('i18n', + function(str){ + return (i18n != undefined ? i18n.t(str) : str); + } + ); }); // Categories diff --git a/client/models/setting.js b/client/models/setting.js index 2132f434e..e3e104432 100644 --- a/client/models/setting.js +++ b/client/models/setting.js @@ -15,6 +15,7 @@ Setting = FormModel.extend({ logoHeight: '', logoWidth: '', defaultEmail: '', + language: 'en', newPostsNotifications: true, backgroundColor: '', secondaryColor: '', diff --git a/client/views/posts/post_item.html b/client/views/posts/post_item.html index c80752563..aa66c906a 100644 --- a/client/views/posts/post_item.html +++ b/client/views/posts/post_item.html @@ -1,7 +1,7 @@