@@ -42,7 +42,13 @@ def initialize(site,base,lang,year,month,posts)
42
42
@month = month
43
43
@dir = File . join ( @dir , @year . to_s , "%.2d" % @month )
44
44
45
- data [ 'title' ] = "#{ MONTHS [ @month ] } #{ @year } Archives"
45
+ if site . config [ 'locales' ] [ 'news' ] [ lang ]
46
+ title = site . config [ 'locales' ] [ 'news' ] [ lang ] [ 'archive_title' ]
47
+ else
48
+ title = site . config [ 'locales' ] [ 'news' ] [ 'en' ] [ 'archive_title' ]
49
+ end
50
+
51
+ data [ 'title' ] = "#{ title [ 'prefix' ] } #{ MONTHS [ @month ] } #{ @year } #{ title [ 'postfix' ] } " . strip
46
52
data [ 'year' ] = year
47
53
end
48
54
@@ -58,7 +64,13 @@ def initialize(site,base,lang,year,posts)
58
64
@year = year
59
65
@dir = File . join ( @dir , @year . to_s )
60
66
61
- data [ 'title' ] = "#{ @year } Archives"
67
+ if site . config [ 'locales' ] [ 'news' ] [ lang ]
68
+ title = site . config [ 'locales' ] [ 'news' ] [ lang ] [ 'archive_title' ]
69
+ else
70
+ title = site . config [ 'locales' ] [ 'news' ] [ 'en' ] [ 'archive_title' ]
71
+ end
72
+
73
+ data [ 'title' ] = "#{ title [ 'prefix' ] } #{ @year } #{ title [ 'postfix' ] } " . strip
62
74
63
75
months = posts . map { |post | post . date . month } . uniq
64
76
@@ -81,7 +93,13 @@ class Index < ArchivePage
81
93
def initialize ( site , base , lang , posts )
82
94
super ( site , base , LAYOUT , lang , posts )
83
95
84
- data [ 'title' ] = 'Recent News'
96
+ if site . config [ 'locales' ] [ 'news' ] [ lang ]
97
+ title = site . config [ 'locales' ] [ 'news' ] [ lang ] [ 'recent_news' ]
98
+ else
99
+ title = site . config [ 'locales' ] [ 'news' ] [ 'en' ] [ 'recent_news' ]
100
+ end
101
+
102
+ data [ 'title' ] = title
85
103
data [ 'years' ] = posts . map { |post | post . date . year } . uniq . reverse
86
104
data [ 'posts' ] = posts . last ( MAX_POSTS ) . reverse
87
105
end
0 commit comments