18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
# File 'lib/jekyll-language-plugin/date_localizer.rb', line 18
def strftime_translate(format = '%F', translation)
result = self.strftime(
format.gsub(/%([aAbB])/){ |m|
case $1
when 'a'; translation['abbr_daynames'][self.wday]
when 'A'; translation['daynames'][self.wday]
when 'b'; translation['abbr_monthnames'][self.mon-1]
when 'B'; translation['monthnames'][self.mon-1]
else
raise JekyllLanguagePlugin::PluginError.new('Internal error.')
end
})
if defined? @@encoding_converter
@@encoding_converter.iconv(result)
else
result
end
end
|