Skip to content

Commit 1f82d4f

Browse files
srgizhMorganov
authored andcommitted
Локализация стандартных атрибутов и даты
Table of Context → Содержание Figure → Рисунок Version → Версия и др.
1 parent a5104de commit 1f82d4f

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

Rakefile

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,24 @@ namespace :book do
1010
task :build do
1111

1212
begin
13+
lang = "ru"
14+
begin
15+
l10n_text = open("https://raw.githubusercontent.com/asciidoctor/asciidoctor/master/data/locale/attributes-#{lang}.adoc").read
16+
File.open('attributes.asc', 'w') { |file| file.puts l10n_text}
17+
progit_txt = File.open('progit.asc').read
18+
if not progit_txt.include?("attributes.asc")
19+
progit_txt.gsub!('include::book/license.asc', "include::attributes.asc[]\ninclude::book/license.asc")
20+
File.open('progit.asc', 'w') {|file| file.puts progit_txt }
21+
end
22+
rescue
23+
end
1324
version_string = ENV['TRAVIS_TAG'] || `git describe --tags`.chomp
1425
if version_string.empty?
1526
version_string = '0'
1627
end
17-
date_string = Time.now.strftime("%Y-%m-%d")
18-
params = "--attribute revnumber='#{version_string}' --attribute revdate='#{date_string}'"
28+
date_string = Time.now.strftime("%d-%m-%Y")
29+
params = "--attribute revnumber='#{version_string}' --attribute revdate='#{date_string}' --attribute lang=#{lang} "
30+
1931
puts "Generating contributors list"
2032
`git shortlog -s | grep -v -E "(Straub|Chacon|dependabot)" | cut -f 2- | column -c 96 > book/contributors.txt`
2133

progit.asc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ $$VERSION$$, $$DATE$$
88
:toclevels: 2
99
:pdf-page-size: A4
1010
:front-cover-image: image:book/cover.png[width=1050,height=1600]
11-
:figure-caption: Рисунок
1211

1312
ifdef::ebook-format[:leveloffset: -1]
1413

0 commit comments

Comments
 (0)