From d7574a9efb947a884506682cd5229a7192da5b22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabi=C3=A1n=20Rodr=C3=ADguez?= Date: Tue, 15 Jan 2013 18:11:07 -0200 Subject: [PATCH] add locale to aspects --- app/assets/javascripts/app/collections/aspects.js | 3 ++- app/assets/templates/aspect_tpl.jst.hbs | 2 +- config/locales/javascript/javascript.en.yml | 4 ++++ spec/javascripts/app/collections/aspects_spec.js | 5 +++++ 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/app/collections/aspects.js b/app/assets/javascripts/app/collections/aspects.js index aeeacb542..33c9cb56c 100644 --- a/app/assets/javascripts/app/collections/aspects.js +++ b/app/assets/javascripts/app/collections/aspects.js @@ -20,6 +20,7 @@ app.collections.Aspects = Backbone.Collection.extend({ }, toSentence: function(){ - return this.selectedAspects('name').join(", ").replace(/,\s([^,]+)$/, ' and $1') || 'My Aspects' + var separator = Diaspora.I18n.t("comma") + ' '; + return this.selectedAspects('name').join(separator).replace(/,\s([^,]+)$/, ' ' + Diaspora.I18n.t("and") + ' $1') || Diaspora.I18n.t("my_aspects"); } }) diff --git a/app/assets/templates/aspect_tpl.jst.hbs b/app/assets/templates/aspect_tpl.jst.hbs index 750af60cf..5e51e1bed 100644 --- a/app/assets/templates/aspect_tpl.jst.hbs +++ b/app/assets/templates/aspect_tpl.jst.hbs @@ -1,6 +1,6 @@
- Pencil + Pencil
{{name}} diff --git a/config/locales/javascript/javascript.en.yml b/config/locales/javascript/javascript.en.yml index ed93233e4..83e95433e 100644 --- a/config/locales/javascript/javascript.en.yml +++ b/config/locales/javascript/javascript.en.yml @@ -9,6 +9,9 @@ en: delete: "Delete" ignore: "Ignore" ignore_user: "Ignore this user?" + and: "and" + comma: "," + edit: "Edit" timeago: prefixAgo: "" prefixFromNow: "" @@ -28,6 +31,7 @@ en: my_activity: "My Activity" my_stream: "Stream" + my_aspects: "My Aspects" videos: watch: "Watch this video on <%= provider %>" diff --git a/spec/javascripts/app/collections/aspects_spec.js b/spec/javascripts/app/collections/aspects_spec.js index 0c879501c..786cec3d6 100644 --- a/spec/javascripts/app/collections/aspects_spec.js +++ b/spec/javascripts/app/collections/aspects_spec.js @@ -1,5 +1,10 @@ describe("app.collections.Aspects", function(){ beforeEach(function(){ + Diaspora.I18n.loadLocale({ + 'and' : "and", + 'comma' : ",", + 'my_aspects' : "My Aspects" + }); var my_aspects = [{ name: 'Work', selected: true }, { name: 'Friends', selected: false }, { name: 'Acquaintances', selected: false }]