adding custom package

This commit is contained in:
Sacha Greif 2013-11-21 11:32:09 +09:00
parent ef537c4987
commit 0cc4ca1bbb
10 changed files with 213 additions and 217 deletions

View file

@ -18,4 +18,4 @@ rss
iron-router iron-router
mailchimp mailchimp
nprogress nprogress
i18next-meteor telescope-i18n

View file

@ -48,9 +48,4 @@ Handlebars.registerHelper('canEdit', function(collectionName, item, action) {
// var itemId = (collectionName==="Posts") ? Session.get('selectedPostId') : Session.get('selectedCommentId'); // var itemId = (collectionName==="Posts") ? Session.get('selectedPostId') : Session.get('selectedCommentId');
// var item=collection.findOne(itemId); // var item=collection.findOne(itemId);
return item && canEdit(Meteor.user(), item, action); return item && canEdit(Meteor.user(), item, action);
}); });
Handlebars.registerHelper('i18n',
function(str){
// return ($.i18n != undefined ? $.i18n.t(str) : str);
}
);

View file

@ -18,16 +18,6 @@ Meteor.subscribe('settings', function(){
// runs once after settings have loaded // runs once after settings have loaded
Session.set('settingsLoaded',true); Session.set('settingsLoaded',true);
analyticsInit(); analyticsInit();
i18n = $.i18n;
// Localisation
i18n.init({
lng: getSetting("language"),
resStore: eval(getSetting("language")),
keyseparator: '::',
nsseparator: ':::'
});
}); });
// Categories // Categories

View file

@ -18,7 +18,7 @@ getNotification = function(event, properties, context){
case 'newReply': case 'newReply':
notification.subject = i18n.t('Someone replied to your comment on')+' "'+p.postHeadline+'"'; notification.subject = i18n.t('Someone replied to your comment on')+' "'+p.postHeadline+'"';
notification.text = p.commentAuthorName+i18n.t(' has replied to your comment on')+' "'+p.postHeadline+'": '+getPostCommentUrl(p.postId, p.commentId); notification.text = p.commentAuthorName+i18n.t(' has replied to your comment on')+' "'+p.postHeadline+'": '+getPostCommentUrl(p.postId, p.commentId);
notification.html = '<p><a href="'+getUserUrl(p.commentAuthorId)+'">'+p.commentAuthorName+'</a>'.i18n.t(' has replied to your comment on')+' "<a href="'+getPostCommentUrl(p.postId, p.commentId)+'" class="action-link">'+p.postHeadline+'</a>"</p>'; notification.html = '<p><a href="'+getUserUrl(p.commentAuthorId)+'">'+p.commentAuthorName+'</a>'+i18n.t(' has replied to your comment on')+' "<a href="'+getPostCommentUrl(p.postId, p.commentId)+'" class="action-link">'+p.postHeadline+'</a>"</p>';
if(context === 'email') if(context === 'email')
notification.html += '<p>'+p.commentExcerpt+'</p><a href="'+getPostCommentUrl(p.postId, p.commentId)+'" class="action-link">'+i18n.t('Read more')+'</a>'; notification.html += '<p>'+p.commentExcerpt+'</p><a href="'+getPostCommentUrl(p.postId, p.commentId)+'" class="action-link">'+i18n.t('Read more')+'</a>';
break; break;

View file

@ -1,194 +1,190 @@
fr = { i18n.translations.fr = {
'fr': { //Navigation
translation: { "Menu": "Menu",
//Navigation "Top": "Top",
"Menu": "Menu", "New": "Nouveau",
"Top": "Top", "Digest": "Résumé",
"New": "Nouveau", "Categories": "Catégories",
"Digest": "Résumé", "Users": "Utilisateurs",
"Categories": "Catégories", "Settings": "Paramètres",
"Users": "Utilisateurs", "Admin": "Admin",
"Settings": "Paramètres", "Post": "Poster",
"Admin": "Admin", "Toolbox": "Outils",
"Post": "Poster", "Sign Up/Sign In": "Connexion/Créer un compte",
"Toolbox": "Outils", "My Account": "Mon compte",
"Sign Up/Sign In": "Connexion/Créer un compte", "View Profile": "Voir le profil",
"My Account": "Mon compte", "Edit Account": "Editer le compte",
"View Profile": "Voir le profil",
"Edit Account": "Editer le compte",
//Main //Main
"New Posts": "Nouveaux Posts", "New Posts": "Nouveaux Posts",
//Commments //Commments
"Your comment has been deleted.": "Votre commentaire a été supprimé.", "Your comment has been deleted.": "Votre commentaire a été supprimé.",
"Comment": "Commentaire", "Comment": "Commentaire",
"Delete Comment": "Supprimer le commentaire", "Delete Comment": "Supprimer le commentaire",
"Add Comment": "Ajouter un commentaire", "Add Comment": "Ajouter un commentaire",
"upvote": "upvote", "upvote": "upvote",
"downvote": "downvote", "downvote": "downvote",
"link": "lien", "link": "lien",
"Edit": "Editer", "Edit": "Editer",
"Reply": "Répondre", "Reply": "Répondre",
"No comments.": "Aucun commentaire.", "No comments.": "Aucun commentaire.",
//Errors //Errors
"You are already logged in": "Vous êtes déjà connecté", "You are already logged in": "Vous êtes déjà connecté",
"Sorry, this is a private site. Please sign up first.": "Désolé mais ce site est privé, vous devez d'abord vous connecter", "Sorry, this is a private site. Please sign up first.": "Désolé mais ce site est privé, vous devez d'abord vous connecter",
"Thanks for signing up!": "Merci pour votre inscription !", "Thanks for signing up!": "Merci pour votre inscription !",
"The site is currently invite-only, but we will let you know as soon as a spot opens up.": "L'accès au site se fait uniquement par invitation. Nous vous informerons dès qu'une place se libère.", "The site is currently invite-only, but we will let you know as soon as a spot opens up.": "L'accès au site se fait uniquement par invitation. Nous vous informerons dès qu'une place se libère.",
"Sorry, you don't have the rights to view this page.": "Désolé, vous n'avez pas le droit de voir cette page.", "Sorry, you don't have the rights to view this page.": "Désolé, vous n'avez pas le droit de voir cette page.",
"Not Found!": "Oups", "Not Found!": "Oups",
"We're sorry; whatever you were looking for isn't here..": "Désolé, mais ce que vous cherchez ne se trouve pas ici...", "We're sorry; whatever you were looking for isn't here..": "Désolé, mais ce que vous cherchez ne se trouve pas ici...",
//Notifications //Notifications
"No notifications": "Aucune notification", "No notifications": "Aucune notification",
"1 notification": "1 notification", "1 notification": "1 notification",
"notifications": "notifications", "notifications": "notifications",
"Mark all as read": "Effacer les notifications", "Mark all as read": "Effacer les notifications",
// Post deleted // Post deleted
"Your post has been deleted.": "Votre post a été supprimé.", "Your post has been deleted.": "Votre post a été supprimé.",
// Post digest // Post digest
"The top 5 posts of each day.": "5 meilleurs post par jours", "The top 5 posts of each day.": "5 meilleurs post par jours",
"Previous Day": "Jour précédent", "Previous Day": "Jour précédent",
"Next Day": "Jour suivant", "Next Day": "Jour suivant",
"Sorry, no posts for today": "Désolé, aucun post aujourd'hui", "Sorry, no posts for today": "Désolé, aucun post aujourd'hui",
"Today": "Aujourd'hui", "Today": "Aujourd'hui",
"Yesterday": "Hier", "Yesterday": "Hier",
// Post submit & edit // Post submit & edit
"Created": "Crée", "Created": "Crée",
"Title": "Titre", "Title": "Titre",
"Suggest title": "Suggérer un titre", "Suggest title": "Suggérer un titre",
"URL": "URL", "URL": "URL",
"Short URL": "URL Courte", "Short URL": "URL Courte",
"Body": "Description", "Body": "Description",
"Category": "Catégorie", "Category": "Catégorie",
"Inactive?": "Inactif ?", "Inactive?": "Inactif ?",
"Sticky?": "Mis en avant ?", "Sticky?": "Mis en avant ?",
"Submission Date": "Date de soumission", "Submission Date": "Date de soumission",
"Submission Time": "Heure de soumission", "Submission Time": "Heure de soumission",
"Date": "Date", "Date": "Date",
"Submission": "Soumission", "Submission": "Soumission",
"Note: this post is still pending so it has no submission timestamp yet.": "Note : ce post est en cours de validation, il n'a pas encore de timestamp.", "Note: this post is still pending so it has no submission timestamp yet.": "Note : ce post est en cours de validation, il n'a pas encore de timestamp.",
"User": "Utilisateur", "User": "Utilisateur",
"Status": "Status", "Status": "Status",
"Approved": "Approuvé", "Approved": "Approuvé",
"Rejected": "Rejeté", "Rejected": "Rejeté",
"Delete Post": "Supprimer le post", "Delete Post": "Supprimer le post",
"Thanks, your post is awaiting approval.": "Merci, votre post est en cours de validation", "Thanks, your post is awaiting approval.": "Merci, votre post est en cours de validation",
"Sorry, couldn't find a title...": "Désolé, impossible de trouver un titre...", "Sorry, couldn't find a title...": "Désolé, impossible de trouver un titre...",
"Please fill in an URL first!": "Vous devez saisir une URL.", "Please fill in an URL first!": "Vous devez saisir une URL.",
// Post item // Post item
"Share": "Partager", "Share": "Partager",
"Discuss": "Discuter", "Discuss": "Discuter",
"Upvote": "Voter", "Upvote": "Voter",
"Sticky": "Mis en avant", "Sticky": "Mis en avant",
"status": "status", "status": "status",
"votes": "votes", "votes": "votes",
"baseScore": "baseScore", "baseScore": "baseScore",
"score": "score", "score": "score",
"clicks": "clics", "clicks": "clics",
"inactive": "inactif", "inactive": "inactif",
"comment": "commentaire", "comment": "commentaire",
"comments": "commentaires", "comments": "commentaires",
"point": "point", "point": "point",
"points": "points", "points": "points",
//User //User
"Please complete your profile below before continuing.": "Merci de compléter votre profil avant de continuer.", "Please complete your profile below before continuing.": "Merci de compléter votre profil avant de continuer.",
"Account": "Compte", "Account": "Compte",
"Username": "Nom d'utilisateur", "Username": "Nom d'utilisateur",
"Display Name": "Nom réel", "Display Name": "Nom réel",
"Email": "Email", "Email": "Email",
"Bio": "Bio", "Bio": "Bio",
"Password": "Mot de passe", "Password": "Mot de passe",
"Change Password?": "Changer de mot de passe", "Change Password?": "Changer de mot de passe",
"Old Password": "Ancien mot de passe", "Old Password": "Ancien mot de passe",
"New Password": "Nouveau mot de passe", "New Password": "Nouveau mot de passe",
"Email Notifications": "Notifications par email", "Email Notifications": "Notifications par email",
"New Posts": "Nouveau Post", "New Posts": "Nouveau Post",
"Comments on my posts": "Commentaires sur mes posts", "Comments on my posts": "Commentaires sur mes posts",
"Replies to my comments": "Reponses à mes commentaires", "Replies to my comments": "Reponses à mes commentaires",
"Forgot password?": "Mot de passe oublié ?", "Forgot password?": "Mot de passe oublié ?",
"Profile updated": "Profil mis à jour", "Profile updated": "Profil mis à jour",
"Please fill in your email below to finish signing up.": "Merci de saisir votre email pour finir la création de votre compte", "Please fill in your email below to finish signing up.": "Merci de saisir votre email pour finir la création de votre compte",
"Invite": "Inviter", "Invite": "Inviter",
"Uninvite": "Annuler l'invitation", "Uninvite": "Annuler l'invitation",
"Make admin": "Rendre admin", "Make admin": "Rendre admin",
"Unadmin": "Supprimer les droits d'admin", "Unadmin": "Supprimer les droits d'admin",
"Delete User": "Supprimer l'utilisateur", "Delete User": "Supprimer l'utilisateur",
"Are you sure you want to delete ": "Etes-vous sur de vouloir supprimer ", "Are you sure you want to delete ": "Etes-vous sur de vouloir supprimer ",
"Reset Password": "Redéfinir le mot de passe", "Reset Password": "Redéfinir le mot de passe",
"Password reset link sent!": "Un lien pour redéfinir votre mot de passe a été envoyé !", "Password reset link sent!": "Un lien pour redéfinir votre mot de passe a été envoyé !",
"Name": "Nom", "Name": "Nom",
"Posts": "Posts", "Posts": "Posts",
"Comments": "Commentaires", "Comments": "Commentaires",
"Karma": "Karma", "Karma": "Karma",
"Is Invited?": "Est-il invité ?", "Is Invited?": "Est-il invité ?",
"Is Admin?": "Est-il Administrateur ?", "Is Admin?": "Est-il Administrateur ?",
"Delete": "Supprimer", "Delete": "Supprimer",
"Member since": "Membre depuis", "Member since": "Membre depuis",
"Edit profile": "Modifier le profil", "Edit profile": "Modifier le profil",
"Sign In": "Connexion", "Sign In": "Connexion",
"Sign in!": "Connexion", "Sign in!": "Connexion",
"Sign up!": "Créer un compte !", "Sign up!": "Créer un compte !",
"Don't have an account?": "Pas encore de compte ?", "Don't have an account?": "Pas encore de compte ?",
"Already have an account?": "Déjà un compte ?", "Already have an account?": "Déjà un compte ?",
"Sign Up": "Créer un compte", "Sign Up": "Créer un compte",
"Please fill in all fields": "Vous devez remplir tous les champs", "Please fill in all fields": "Vous devez remplir tous les champs",
"Invite ": "Invitation ", "Invite ": "Invitation ",
"left": " restante", "left": " restante",
"Invite (none left)": "Invitation (aucune restante)", "Invite (none left)": "Invitation (aucune restante)",
"All": "All", "All": "All",
"Invited": "Invité", "Invited": "Invité",
"Uninvited": "Pas invité", "Uninvited": "Pas invité",
"Filter by": "Filtrer par", "Filter by": "Filtrer par",
"Sort by": "Trier par", "Sort by": "Trier par",
//Helpers //Helpers
"Sorry, you do not have access to this page": "Désolé, vous n'avez pas accès à cette page", "Sorry, you do not have access to this page": "Désolé, vous n'avez pas accès à cette page",
"Please Sign In First.": "Vous devez d'abord vous connecter.", "Please Sign In First.": "Vous devez d'abord vous connecter.",
"Sorry, you have to be an admin to view this page.": "Désolé, vous devez être administrateur pour voir cette page.", "Sorry, you have to be an admin to view this page.": "Désolé, vous devez être administrateur pour voir cette page.",
"Sorry, you don't have permissions to add new items.": "Désolé, vous n'avez pas la permission d'ajouter de nouveaux posts.", "Sorry, you don't have permissions to add new items.": "Désolé, vous n'avez pas la permission d'ajouter de nouveaux posts.",
"Sorry, you cannot edit this post.": "Désolé, vous ne pouvez pas modifier ce post.", "Sorry, you cannot edit this post.": "Désolé, vous ne pouvez pas modifier ce post.",
"Sorry, you cannot edit this comment.": "Désolé, vous ne pouvez pas modifier ce commentaire.", "Sorry, you cannot edit this comment.": "Désolé, vous ne pouvez pas modifier ce commentaire.",
//Collections //Collections
"You need to login and be an admin to add a new category.": "Vous devez être administrateur et connecté pour ajouter une catégorie", "You need to login and be an admin to add a new category.": "Vous devez être administrateur et connecté pour ajouter une catégorie",
"You need to login or be invited to post new comments.": "Vous devez être connecté et invité pour poster des commentaires", "You need to login or be invited to post new comments.": "Vous devez être connecté et invité pour poster des commentaires",
"Please wait ": "Merci de patienter ", "Please wait ": "Merci de patienter ",
" seconds before commenting again": " secondes avant de poster un nouveau commentaire", " seconds before commenting again": " secondes avant de poster un nouveau commentaire",
"Your comment is empty.": "Votre commentaire est vide", "Your comment is empty.": "Votre commentaire est vide",
"You don't have permission to delete this comment.": "Vous n'avez pas la permission de supprimer ce commentaire", "You don't have permission to delete this comment.": "Vous n'avez pas la permission de supprimer ce commentaire",
"You need to login or be invited to post new stories.": "Vous devez être connecté ou invité pour créer un nouveau post", "You need to login or be invited to post new stories.": "Vous devez être connecté ou invité pour créer un nouveau post",
"Please fill in a headline": "Merci de saisir un titre", "Please fill in a headline": "Merci de saisir un titre",
"This link has already been posted": "Ce lien a déjà été posté", "This link has already been posted": "Ce lien a déjà été posté",
"Sorry, you cannot submit more than ": "Désolé, vous ne pouvez pas créer plus de ", "Sorry, you cannot submit more than ": "Désolé, vous ne pouvez pas créer plus de ",
" posts per day": " posts par jour", " posts per day": " posts par jour",
"Someone replied to your comment on": "Quelqu'un à répondu à votre commentaire sur", "Someone replied to your comment on": "Quelqu'un à répondu à votre commentaire sur",
" has replied to your comment on": " a répondu à votre commentaire sur", " has replied to your comment on": " a répondu à votre commentaire sur",
"Read more": "Lire la suite", "Read more": "Lire la suite",
"A new comment on your post": "Un nouveau commentaire sur votre post", "A new comment on your post": "Un nouveau commentaire sur votre post",
"You have a new comment by ": "Vous avez un nouveau commentaire de ", "You have a new comment by ": "Vous avez un nouveau commentaire de ",
" on your post": " sur votre post", " on your post": " sur votre post",
" has created a new post": " a créer un nouveau post", " has created a new post": " a créer un nouveau post",
"Your account has been approved.": "Votre compte a été validé.", "Your account has been approved.": "Votre compte a été validé.",
"Welcome to ": "Bienvenu sur ", "Welcome to ": "Bienvenu sur ",
"Start posting.": "Commencer à poster.", "Start posting.": "Commencer à poster.",
//Common //Common
"Pending": "En attente", "Pending": "En attente",
"Loading...": "Chargement...", "Loading...": "Chargement...",
"Submit": "Envoyer", "Submit": "Envoyer",
"You must be logged in.": "Vous devez être connecté", "You must be logged in.": "Vous devez être connecté",
"Are you sure?": "Etes-vous sur ?", "Are you sure?": "Etes-vous sur ?",
"Please log in first": "Vous devez être connecté", "Please log in first": "Vous devez être connecté",
"Sign In/Sign Up with Twitter": "Connexion/Créer un compte avec Twitter", "Sign In/Sign Up with Twitter": "Connexion/Créer un compte avec Twitter",
"Load more": "Charger plus" "Load more": "Charger plus"
}
}
}; };

1
packages/telescope-i18n/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
.build*

View file

@ -0,0 +1,19 @@
i18n = {
translations: [],
t: function (str) {
var lang = getSetting('language', 'en');
if(i18n.translations[lang] && i18n.translations[lang][str]){
return i18n.translations[lang][str];
}
return str;
}
};
if(Meteor.isClient){
Handlebars.registerHelper('i18n', function(str){
return i18n.t(str);
});
}

View file

@ -0,0 +1,7 @@
Package.describe("Telescope i18n package");
Package.on_use(function (api) {
api.use(['handlebars'], 'client');
api.add_files(['i18n.js'], ['client', 'server']);
api.export('i18n');
});

View file

@ -8,9 +8,6 @@
}, },
"crypto-md5": {}, "crypto-md5": {},
"iron-router": {}, "iron-router": {},
"i18next-meteor": {
"git": "git://github.com/SachaG/i18next-meteor.git"
},
"nprogress": {} "nprogress": {}
} }
} }

View file

@ -10,10 +10,6 @@
}, },
"crypto-md5": {}, "crypto-md5": {},
"iron-router": {}, "iron-router": {},
"i18next-meteor": {
"git": "git://github.com/SachaG/i18next-meteor.git",
"branch": "master"
},
"nprogress": {} "nprogress": {}
}, },
"packages": { "packages": {
@ -23,9 +19,9 @@
"commit": "59a762e297082eea8b8cae00374c2b7ac6f89529" "commit": "59a762e297082eea8b8cae00374c2b7ac6f89529"
}, },
"crypto-base": { "crypto-base": {
"git": "https://github.com/tmeasday/meteor-crypto-base.git", "git": "https://github.com/oortcloud/meteor-crypto-base.git",
"tag": "v0.0.3", "tag": "v3.1.2.1",
"commit": "fdc0b7b3d24e2e31c5c95beddafe890ffbaafd42" "commit": "5df8d82a0595553415bbfae2930c6ecbeece5794"
}, },
"database-forms": { "database-forms": {
"git": "git://github.com/SachaG/database-forms.git", "git": "git://github.com/SachaG/database-forms.git",
@ -33,20 +29,15 @@
"commit": "b11ac7d5ca10df610ee5ca810cde45bb38ac81b7" "commit": "b11ac7d5ca10df610ee5ca810cde45bb38ac81b7"
}, },
"crypto-md5": { "crypto-md5": {
"git": "https://github.com/tmeasday/meteor-crypto-md5.git", "git": "https://github.com/oortcloud/meteor-crypto-md5.git",
"tag": "v0.0.2", "tag": "v3.1.2.2",
"commit": "a943bea4cffeac9a14c2825dfe57d32b9d677e6f" "commit": "75bbb3eeace302122d3554a6212a6fe92553fa18"
}, },
"iron-router": { "iron-router": {
"git": "https://github.com/EventedMind/iron-router.git", "git": "https://github.com/EventedMind/iron-router.git",
"tag": "v0.6.1", "tag": "v0.6.1",
"commit": "4e1ee0581d68bff422a915dacb0bd30eae10fe08" "commit": "4e1ee0581d68bff422a915dacb0bd30eae10fe08"
}, },
"i18next-meteor": {
"git": "git://github.com/SachaG/i18next-meteor.git",
"branch": "master",
"commit": "429adc8e5f8049a3b0f4e6186d94482799253059"
},
"nprogress": { "nprogress": {
"git": "https://github.com/zhouzhuojie/meteor-nprogress.git", "git": "https://github.com/zhouzhuojie/meteor-nprogress.git",
"tag": "v0.0.3", "tag": "v0.0.3",