Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

add basic English intro #58

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
22 changes: 15 additions & 7 deletions www/_includes/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,27 @@
<script src="/leaflet/leaflet.js"></script>
<script src="/js/turbolinks.js"></script>
<link rel="shortcut icon" href="/img/favicon.ico">
{% assign base = '' %}
{% if page.lang != "de" %}
{% assign base = "/" | append: page.lang | append: "/" %}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either assign base = "/" above, or leave out the first "/" here. It should either be "/" and "/en/", or "" and "en/" (I believe the former, so links are interpreted correctly as domain-relative when in a deeper path).

{% endif %}
</head>
<body lang="de">

<div class="site">
<div class="menu_scroll_wrapper"><div class="menu">
<a {% if page.url == "/index.html" %} class="active" {% endif %} href="/">tl;dr</a>
<a {% if page.url == "/howtotreff.html" %} class="active" {% endif %} href="/howtotreff.html">Treff</a>
<a {% if page.url == "/chaotische_viertelstunde.html" %} class="active" {% endif %} href="/chaotische_viertelstunde.html?latest={{ page.vortraege_latest }}">c¼h</a>
<a {% if page.url == "/verein.html" %} class="active" {% endif %} href="/verein.html">Verein</a>
<a {% if page.url == "/kontakt.html" %} class="active" {% endif %} href="/kontakt.html">Kontakt</a>
<a {% if page.url == "{{base}}index.html" %} class="active" {% endif %} href="{{base}}index.html">tl;dr</a>
<a {% if page.url == "{{base}}howtotreff.html" %} class="active" {% endif %} href="{{base}}howtotreff.html">Treff</a>
<a {% if page.url == "{{base}}chaotische_viertelstunde.html" %} class="active" {% endif %} href="{{base}}chaotische_viertelstunde.html?latest={{ page.vortraege_latest }}">c¼h</a>
<a {% if page.url == "{{base}}verein.html" %} class="active" {% endif %} href="{{base}}verein.html">Verein</a>
<a {% if page.url == "{{base}}kontakt.html" %} class="active" {% endif %} href="{{base}}kontakt.html">Kontakt</a>
<a data-no-turbolink href="https://www.noname-ev.de/w/">Wiki</a>
<a {% if page.url == "/cryptoparty.html" %} class="active" {% endif %} href="/cryptoparty.html">Cryptoparty</a>
<a {% if page.url == "/en/intro.html" %} class="active" {% endif %} href="/en/intro.html" lang="en">English</a>
<a {% if page.url == "{{base}}cryptoparty.html" %} class="active" {% endif %} href="{{base}}cryptoparty.html">Cryptoparty</a>
{% if page.lang == "de" %}
<a href="{{ 'en/' | append: page.url | replace: '//','/' }}" lang="en">English</a>
{% else %}
<a href="{{ page.url | replace: 'en/','' }}" lang="de">Deutsch</a>
{% endif %}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still unhappy about having this in the navigation… Can't it be in the sidebar? Or… anywhere else? :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and this will still break the navbar layout. This issue have to be fixed first (ref #55).

</div></div>

<div class="cont">
33 changes: 33 additions & 0 deletions www/_plugins/lang_polyfill.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# encoding: utf-8



module Jekyll
class LangPolyfill < Generator
priority :high

def generate(site)
fakes = site.pages.map do |p|
next if p.data['lang'] != 'de'
next if File.exist?("en/#{p.name}")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't that be p.path?


copy = p.dup
copy.data['lang'] = 'en'
copy.process("en/#{copy.name}")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copy.path?

copy.data['title'] << " (untranslated, sorry)"

notice = <<~NOTICE
# Translation missing
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be sensible to put this in a <div> with a class, so that we can highlight it specifically and make it stand out as an info-box (As done here like so)


Sorry, unfortunately the current page has not been translated yet. [Maybe an
automated translation suffices](https://translate.google.com/translate?hl=en&sl=de&tl=en&u=#{site.config['url']}#{copy.url})?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only link automated translation. A link goes to a thing, not a statement.

NOTICE
copy.content = "#{notice}\n\n#{copy.content}"

copy
end.compact

site.pages += fakes
end
end
end
2 changes: 1 addition & 1 deletion www/edit_c14.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ title: c¼h editieren
<p>
Bitte speichere folgenden Link. Du brauchst ihn, wenn du in Zukunft deinen
Eintrag editieren willst:<br />
<a href="/edit_c14.html?id=(( .Id ))&pw=(( .Password.String ))">http://www.noname-ev.de/edit_c14.html?id=(( .Id ))&pw=(( .Password.String ))</a>
<a href="edit_c14.html?id=(( .Id ))&pw=(( .Password.String ))">http://www.noname-ev.de/edit_c14.html?id=(( .Id ))&pw=(( .Password.String ))</a>
</p>
(( end ))

Expand Down
File renamed without changes.