Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Indicate the number of available languages #43

Merged
merged 2 commits into from
Sep 17, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## master (unreleased)

* Added a "language count" on the homepage (#43)

## 2.3.0 (2016-09-16)

* Fix the Italian "Cockatrice" translation (#40).
Expand Down
3 changes: 3 additions & 0 deletions index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@ See the [License page](license.html) for more details.

## List of available texts

"The Black Hack" core rules are currently available in $language_count languages (and soon, yours?):

$text_list


## Contributing

If you have any remark, noticed any typo, or want to add a translation in your language, please proceed to the [Github project](https://github.com/brunobord/the-black-hack#contribute) and follow the instructions. Although it's easier if you're a Github user, you can contribute without it, via email or other communication channels.
Expand Down
7 changes: 5 additions & 2 deletions toolbox/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
class Builder(object):

exceptions = (
'build', 'static', 'templates', 'tests',
'build', 'static', 'templates', 'tests', 'toolbox',
# Warning: ignoring it to add it on the top position in the list
'english',
)
Expand Down Expand Up @@ -216,7 +216,10 @@ def build_homepage(self):
homepage_md = self.get_template('index.md')
text_list = self.build_homepage_text_list()
# Build generated body using text_list
body_md = homepage_md.substitute(text_list='\n'.join(text_list))
body_md = homepage_md.substitute(
text_list='\n'.join(text_list),
language_count=len(self.languages),
)
body_html = self.convert_md_source(body_md)
# Build html page content
self.write_html(
Expand Down