Skip to content

Commit

Permalink
make chrome strings translatable
Browse files Browse the repository at this point in the history
  • Loading branch information
eighthave committed Jul 23, 2020
1 parent 6888273 commit 055aff2
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 4 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ docs](https://github.com/fsfe/reuse-docs).
Generally, we invite you to contact and join the [REUSE mailing
list](https://lists.fsfe.org/mailman/listinfo/reuse).

### Translation

The website "chrome" strings are localized using the standard,
built-in [Hugo i18n](https://gohugo.io/content-management/multilingual/)
support. Those files are in _data/_.

## License

The theme used for this website is based on [github-project-landing-page](https://github.com/nsomar/github-project-landing-page) which is licensed under the
Expand Down
6 changes: 6 additions & 0 deletions site/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ style = "emacs"
Mastodon = "mastodon.social/@fsfe"
Diaspora = ""

DefaultContentLanguage = "en"
defaultContentLanguageInSubdir = true
[languages]
[languages.en]
weight = 1

[menu]
[[menu.main]]
name = "Get Started"
Expand Down
10 changes: 10 additions & 0 deletions site/i18n/en.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
table_of_contents:
other: "Table of Contents"
toggle_navigation:
other: "Toggle navigation"
warning:
other: "Warning:"
noscript_warning:
other: "Some interactive features will not work with JavaScript disabled."
tool_instructions:
other: "Tool instructions for this step"
4 changes: 2 additions & 2 deletions site/layouts/partials/nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
-->
<!-- Navigation -->
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
<noscript><div class="noscript"><strong>Warning:</strong> Some interactive features will not work with JavaScript disabled.</div></noscript>
<noscript><div class="noscript"><strong>{{ i18n "warning" }}</strong> {{ i18n "noscript_warning" }}</div></noscript>
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header page-scroll">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="sr-only">{{ i18n "toggle_navigation" }}</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
Expand Down
2 changes: 1 addition & 1 deletion site/layouts/shortcodes/box-tool.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<div class="panel panel-default" id="toc">
<div class="panel-heading" role="tab" id="headingOne">
<a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#{{ $id }}" aria-expanded="false" aria-controls="collapseOne">
<h4 class="panel-title">Tool instructions for this step</h4>
<h4 class="panel-title">{{ i18n "tool_instructions" }}</h4>
</a>
</div>
<div id="{{ $id }}" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingOne">
Expand Down
2 changes: 1 addition & 1 deletion site/layouts/shortcodes/toc.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<div class="panel panel-default" id="toc">
<div class="panel-heading" role="tab" id="headingOne">
<a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseOne" aria-expanded="false" aria-controls="collapseOne">
<h4 class="panel-title">Table of Contents</h4>
<h4 class="panel-title">{{ i18n "table_of_contents" }}</h4>
</a>
</div>
<div id="collapseOne" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingOne">
Expand Down

0 comments on commit 055aff2

Please sign in to comment.