-
Notifications
You must be signed in to change notification settings - Fork 42
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
base: master
Are you sure you want to change the base?
Conversation
www/english.md
Outdated
(„Stammtisch“). [Please RSVP](yarpnarp.html) a couple of days in advance, so | ||
that we can book a suitable table. It’s pretty simple, just enter your nick | ||
and click “yarp”. Be sure to check the site again before you go, sometimes we | ||
need to choose a different place if there's too many people. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/there's/there are/
www/_includes/termine_en.md
Outdated
{% endif %} | ||
{% else %} | ||
regular meeting (<a href="anfahrt.html">Route?</a>)<br> | ||
lightning talk: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't agree with the characterization as "lightning talk" here. I'd say "short talk" or just "talk", but lightning talk, to me, implies that there will be a series of quick-fire talks with a specific format.
I think it would be preferrable, if the English pages are in their own subfolder (say, Hardcoding which pages do and do not have translations and doing all the linking and such manually seems like a world of pain. Have you googled around a bit about how to best set up multi-lingual jekyll-pages? |
I intentionally decided against doing l10n because it is continuous effort, which I want to keep low. I believe it is simply not worth our time to invest into doing more than a single extra page. That being said, it is very well worth it to see if jekyll has some defaults/standards/whatever that would simplify this single different-language page, as I did not check. I can do that tomorrow, along with your other remarks. |
www/_includes/header.html
Outdated
@@ -24,6 +24,7 @@ | |||
<a {% if page.url == "/kontakt.html" %} class="active" {% endif %} href="/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 == "/english.html" %} class="active" {% endif %} href="/english.html" lang="en">English</a> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer the "English"-Button to be in the top right, possibly by inserting the web equivalent of LaTeX's \hfill, though I'm not sure if this would lead people to believe that this is a "language switch", which it is not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Too much effort, but feel free to give it a try: https://stackoverflow.com/questions/14920401/how-to-simulate-hfill-with-html-and-css The most obvious float: right
fails once the menu goes into overflow mode because the element gets pushed down.
Regarding "l10n plugin/standard": The top results all do more or less what I did here: define a lang and a ref in the frontmatter, to be able to connect translated pages. Links and language switcher are generated by essentially looping over all pages, it seems. Long story short, I see no advantage to switch to their handcrafted solution over mine, especially since there are multiple hand crafted suggestions. |
Still see the advantage of having it in a separate dir (or a predictable URL-schema), that we can use the Accept-Language header to automatically redirect/serve the correct language. Which I consider a significant usability advantage, even if only part of the page is actually translated. I also consider it actively simpler and more extensible than special-casing templates and adding links and things to sub-pages. For example, what if someone decides to translate the Treff, Kontakt or the Cryptoparty or whatever page? Do we add a separate navigation item for each? Doing it this way is definitely easier now, but I also think it pretty much locks us into having only this one translated page for ~ever. I just don't think that's a good idea; I would prefer to keep the option to gradually add translations over time, if we feel it's a good idea. To be clear: I don't suggest doing full-blown i18n/l10n, just that a) if we have an English page for something, someone preferring English should get it served automatically and b) translating a page should, ideally, be as simple as adding a new, translated file. Anyway. In the end, I'm not doing the work and am not, in any way, a decider here, so ¯_(ツ)_/¯. Just giving my 2¢. |
|
Instead, let's say we do the following: We have a separate Now, obviously this isn't a trivial effort, so I don't suggest to do it right now. But I also don't think it's a huge effort to do and if we, at least, start out by naming the files appropriately and linking to them correctly, we can already prepare for that (also consider, that renaming files later isn't advisable, as that would break permalinks, so it's worth getting this right from the start). In short, I think a) the file should have the same name as the German version, but be in the If we truly believe, that we'll never translate more of the page, it doesn't matter. Personally, I'd prefer us to not believe that right now. |
Enhanced the patch, please take a look |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but the eff I know :)
@@ -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: "/" %} |
There was a problem hiding this comment.
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).
www/_includes/header.html
Outdated
<a href="{{ 'en/' | append: page.url | replace: '//','/' }}" lang="en">English</a> | ||
{% else %} | ||
<a href="{{ page.url | replace: 'en/','' }}" lang="de">Deutsch</a> | ||
{% endif %} |
There was a problem hiding this comment.
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? :)
There was a problem hiding this comment.
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).
www/_plugins/lang_polyfill.rb
Outdated
def generate(site) | ||
fakes = site.pages.map do |p| | ||
next if p.data['lang'] != 'de' | ||
next if File.exist?("en/#{p.name}") |
There was a problem hiding this comment.
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
?
www/_plugins/lang_polyfill.rb
Outdated
|
||
copy = p.dup | ||
copy.data['lang'] = 'en' | ||
copy.process("en/#{copy.name}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
copy.path
?
www/_plugins/lang_polyfill.rb
Outdated
# Translation missing | ||
|
||
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})? |
There was a problem hiding this comment.
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.
www/_plugins/lang_polyfill.rb
Outdated
copy.data['title'] << " (untranslated, sorry)" | ||
|
||
notice = <<~NOTICE | ||
# Translation missing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
www/_includes/header.html
Outdated
@@ -24,6 +24,7 @@ | |||
<a {% if page.url == "/kontakt.html" %} class="active" {% endif %} href="/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 == "/english.html" %} class="active" {% endif %} href="/english.html" lang="en">English</a> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bevor wir einen neuen Menüpunkt hinzugefügt wird muss dringend das Layoutproblem gelöst werden.
www/_includes/header.html
Outdated
<a href="{{ 'en/' | append: page.url | replace: '//','/' }}" lang="en">English</a> | ||
{% else %} | ||
<a href="{{ page.url | replace: 'en/','' }}" lang="de">Deutsch</a> | ||
{% endif %} |
There was a problem hiding this comment.
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).
Branch rebased. @koebi do you want to review again? |
Basic stuff definitely works, although I didn't setup the DB and stuff to see if
termine_en.md
works actually works or looks okay. It's a copy&paste from the German version, with some renames to make it less confusing for others. I hope it fits the sidebar, but I didn't check.