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

add basic English intro #58

wants to merge 7 commits into from

Conversation

breunigs
Copy link
Contributor

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.

@breunigs breunigs requested a review from koebi May 30, 2017 18:19
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.
Copy link
Contributor

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/

{% endif %}
{% else %}
regular meeting (<a href="anfahrt.html">Route?</a>)<br>
lightning talk:
Copy link
Contributor

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.

@Merovius
Copy link
Contributor

I think it would be preferrable, if the English pages are in their own subfolder (say, https://www.noname-ev.de/en/…). That would enable us to, in the nginx-config, swap the root based on the Accept-Language-Header. We would need to think about how to handle pages without translations, though. In the beginning, it might be possible/sensible/easy to just symlink the German version in?

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?

@breunigs
Copy link
Contributor Author

breunigs commented May 30, 2017

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.

@@ -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>
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@breunigs
Copy link
Contributor Author

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.

@Merovius
Copy link
Contributor

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¢.

@breunigs
Copy link
Contributor Author

breunigs commented May 31, 2017

  1. Separate folder: there you go, easy as pie.
  2. Content negotiation would indeed be nice, but the suggestions are a joke: "use a perl script" or "compile nginx manually". I would keep this in mind for later, when maybe the situation improves.
  3. Can you elaborate your lock-in argument? My patch of course hinges on the fact that the website will not need a better multi-lang approach anytime soon. Even if it does, I don't see how moving this single page increases the effort tremendously. Is there some hard to reverse decision in the patch that I fail to see? Otherwise I'd see it as a creative work avoidance approach, i.e. just putting all the hard work onto the next guy.

@Merovius
Copy link
Contributor

  1. I actually assumed content negotiation in nginx to be simpler. There seem to be some alternatives (one of which is using nginx's lua scripting support), but nothing even close to as simple as I imagined. Bummer. We can figure that out later, though.

  2. Currently, AIUI, there is an item added to the main navigation named "English", which links to /en/intro.html. How would that look, if we where to add a translation of howtotreff.html? Add an "Meeting (English)" link to the navigation? I hardly think so. Honestly, even this one additional link already looks wrong to me; this isn't different content, it's just provided in a different language.

Instead, let's say we do the following: We have a separate en/ subtree, mirroring the current, German tree. We rewrite links to {% page.lang %}/foobar.html. Via, e.g., a plugin, we populate the en/ subtree; every page that doesn't have a translation already, gets mirrored there, possibly with a banner "Sorry, this page isn't available in English, showing the German version" and the page.lang variable set to en. In this scheme, now, if a user ends in the en/ subtree (whether via Content-Negotiation, a search-engine showing the correct page for their language or a link on our page to "show English version of this site"), they will stay in the en/-subtree, all links will automatically point to an English version, if available and fall back to German, if not…

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 en/-subtree and b) the link probably shouldn't be in the main navigation, but instead as a "show this page in English" on the specific page itself. Seems simple enough to me, while also being future proof for above scheme.

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.

@breunigs
Copy link
Contributor Author

breunigs commented Jun 1, 2017

Enhanced the patch, please take a look

Copy link
Contributor

@Merovius Merovius left a 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: "/" %}
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).

<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).

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?

# 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})?
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.

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)

@@ -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>
Copy link
Member

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.

<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
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).

@joker234
Copy link
Member

Branch rebased. @koebi do you want to review again?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants