mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: translation issues with top periods
This commit is contained in:
parent
7749b3e99f
commit
1fd50634f0
@ -10,14 +10,14 @@ export default Ember.Component.extend(StringBuffer, {
|
|||||||
title: function() {
|
title: function() {
|
||||||
var categoryName = this.get('content.categoryName'),
|
var categoryName = this.get('content.categoryName'),
|
||||||
name = this.get('content.name'),
|
name = this.get('content.name'),
|
||||||
extra;
|
extra = {};
|
||||||
|
|
||||||
if (categoryName) {
|
if (categoryName) {
|
||||||
extra = { categoryName: categoryName };
|
|
||||||
name = "category";
|
name = "category";
|
||||||
|
extra.categoryName = categoryName;
|
||||||
}
|
}
|
||||||
return I18n.t("filters." + name + ".help", extra);
|
return I18n.t("filters." + name.replace("/", ".") + ".help", extra);
|
||||||
}.property("content.name"),
|
}.property("content.{categoryName,name}"),
|
||||||
|
|
||||||
active: function() {
|
active: function() {
|
||||||
return this.get('content.filterMode') === this.get('filterMode') ||
|
return this.get('content.filterMode') === this.get('filterMode') ||
|
||||||
@ -33,11 +33,11 @@ export default Ember.Component.extend(StringBuffer, {
|
|||||||
name = 'category';
|
name = 'category';
|
||||||
extra.categoryName = Discourse.Formatter.toTitleCase(categoryName);
|
extra.categoryName = Discourse.Formatter.toTitleCase(categoryName);
|
||||||
}
|
}
|
||||||
return I18n.t("filters." + name + ".title", extra);
|
return I18n.t("filters." + name.replace("/", ".") + ".title", extra);
|
||||||
}.property('content.count'),
|
}.property('content.{categoryName,name,count}'),
|
||||||
|
|
||||||
renderString: function(buffer) {
|
renderString(buffer) {
|
||||||
var content = this.get('content');
|
const content = this.get('content');
|
||||||
buffer.push("<a href='" + content.get('href') + "'>");
|
buffer.push("<a href='" + content.get('href') + "'>");
|
||||||
if (content.get('hasIcon')) {
|
if (content.get('hasIcon')) {
|
||||||
buffer.push("<span class='" + content.get('name') + "'></span>");
|
buffer.push("<span class='" + content.get('name') + "'></span>");
|
||||||
|
@ -2,6 +2,7 @@ import DiscourseController from 'discourse/controllers/controller';
|
|||||||
|
|
||||||
export default DiscourseController.extend({
|
export default DiscourseController.extend({
|
||||||
needs: ['discovery', 'discovery/topics'],
|
needs: ['discovery', 'discovery/topics'],
|
||||||
|
|
||||||
categories: function() {
|
categories: function() {
|
||||||
return Discourse.Category.list();
|
return Discourse.Category.list();
|
||||||
}.property(),
|
}.property(),
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
import { iconHTML } from 'discourse/helpers/fa-icon';
|
import { iconHTML } from 'discourse/helpers/fa-icon';
|
||||||
|
|
||||||
const TITLE_SUBS = { yearly: 'this_year',
|
const TITLE_SUBS = {
|
||||||
monthly: 'this_month',
|
all: 'all_time',
|
||||||
daily: 'today',
|
yearly: 'this_year',
|
||||||
all: 'all' };
|
monthly: 'this_month',
|
||||||
|
daily: 'today',
|
||||||
|
};
|
||||||
|
|
||||||
export default Ember.Handlebars.makeBoundHelper(function (period) {
|
export default Ember.Handlebars.makeBoundHelper(function (period) {
|
||||||
const title = I18n.t('filters.top.' + (TITLE_SUBS[period] || 'this_week'));
|
const title = I18n.t('filters.top.' + (TITLE_SUBS[period] || 'this_week'));
|
||||||
|
@ -1552,15 +1552,17 @@ en:
|
|||||||
top:
|
top:
|
||||||
title: "Top"
|
title: "Top"
|
||||||
help: "the most active topics in the last year, month, week or day"
|
help: "the most active topics in the last year, month, week or day"
|
||||||
|
all:
|
||||||
|
title: "All Time"
|
||||||
yearly:
|
yearly:
|
||||||
title: "Top Yearly"
|
title: "Yearly"
|
||||||
monthly:
|
monthly:
|
||||||
title: "Top Monthly"
|
title: "Monthly"
|
||||||
weekly:
|
weekly:
|
||||||
title: "Top Weekly"
|
title: "Weekly"
|
||||||
daily:
|
daily:
|
||||||
title: "Top Daily"
|
title: "Daily"
|
||||||
all: "All Time"
|
all_time: "All Time"
|
||||||
this_year: "This year"
|
this_year: "This year"
|
||||||
this_month: "This month"
|
this_month: "This month"
|
||||||
this_week: "This week"
|
this_week: "This week"
|
||||||
|
Loading…
Reference in New Issue
Block a user