add locale to aspects
This commit is contained in:
parent
0f499e7c2e
commit
d7574a9efb
4 changed files with 12 additions and 2 deletions
|
|
@ -20,6 +20,7 @@ app.collections.Aspects = Backbone.Collection.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
toSentence: function(){
|
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");
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<div class="edit">
|
<div class="edit">
|
||||||
<a href="/aspects/{{id}}/edit" rel="facebox">
|
<a href="/aspects/{{id}}/edit" rel="facebox">
|
||||||
<img alt="Pencil" src="{{imageUrl "icons/pencil.png"}}" title="Edit {{name}}">
|
<img alt="Pencil" src="{{imageUrl "icons/pencil.png"}}" title="{{t 'edit'}} {{name}}">
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<a class="aspect_selector name" data-guid="{{id}}" href="/aspects/query"> {{name}} </a>
|
<a class="aspect_selector name" data-guid="{{id}}" href="/aspects/query"> {{name}} </a>
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,9 @@ en:
|
||||||
delete: "Delete"
|
delete: "Delete"
|
||||||
ignore: "Ignore"
|
ignore: "Ignore"
|
||||||
ignore_user: "Ignore this user?"
|
ignore_user: "Ignore this user?"
|
||||||
|
and: "and"
|
||||||
|
comma: ","
|
||||||
|
edit: "Edit"
|
||||||
timeago:
|
timeago:
|
||||||
prefixAgo: ""
|
prefixAgo: ""
|
||||||
prefixFromNow: ""
|
prefixFromNow: ""
|
||||||
|
|
@ -28,6 +31,7 @@ en:
|
||||||
|
|
||||||
my_activity: "My Activity"
|
my_activity: "My Activity"
|
||||||
my_stream: "Stream"
|
my_stream: "Stream"
|
||||||
|
my_aspects: "My Aspects"
|
||||||
|
|
||||||
videos:
|
videos:
|
||||||
watch: "Watch this video on <%= provider %>"
|
watch: "Watch this video on <%= provider %>"
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,10 @@
|
||||||
describe("app.collections.Aspects", function(){
|
describe("app.collections.Aspects", function(){
|
||||||
beforeEach(function(){
|
beforeEach(function(){
|
||||||
|
Diaspora.I18n.loadLocale({
|
||||||
|
'and' : "and",
|
||||||
|
'comma' : ",",
|
||||||
|
'my_aspects' : "My Aspects"
|
||||||
|
});
|
||||||
var my_aspects = [{ name: 'Work', selected: true },
|
var my_aspects = [{ name: 'Work', selected: true },
|
||||||
{ name: 'Friends', selected: false },
|
{ name: 'Friends', selected: false },
|
||||||
{ name: 'Acquaintances', selected: false }]
|
{ name: 'Acquaintances', selected: false }]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue