Skip to content

Localized Overview index page #129

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

Merged
merged 1 commit into from
Nov 27, 2012
Merged

Conversation

eed3si9n
Copy link
Member

@eed3si9n eed3si9n commented Nov 8, 2012

Hi

I've been translating/porting a bunch of overview docs into Japanese lately. I figured it'd be nice to have a nice landing page for them so decided to localize the index page. See:

screenshot

changes

overview: xyz entry was added YAML frontmatter to link the English originals to the translations. For example:

overview: string-interpolation

On the translated side, we just need to add the same entry. I also changed guides-index so the flags show up on the unused right-hand side span6. This is controlled by languages: ja on English index.md.

adding more languages

I've refactored the index page generation logic into localized-overview-index.txt so with minimal change Spanish index page should also be generated (@migue):

  1. Create index.md following the Japanese sample.
  2. Add es to languages: ja in English index.md.

@heathermiller
Copy link
Member

This seems great, we'd be happy to have it. However I'm having a bit of difficulty building it locally, by just running:

jekyll --server

Not sure what the issue is right this moment, looking into it...

@heathermiller
Copy link
Member

Problem solved- nevermind the concern.

This looks great! Thanks a lot for putting this together. Let me first poke around a bit and make a couple of tweaks, and then I'll pull it right in.

Thanks again.

@eed3si9n
Copy link
Member Author

poke.

@heathermiller
Copy link
Member

Thanks for the nudge. :)

heathermiller added a commit that referenced this pull request Nov 27, 2012
Localized Overview index page
@heathermiller heathermiller merged commit fa6f0aa into scala:master Nov 27, 2012
@eed3si9n
Copy link
Member Author

Thanks for getting this in. I see that Collections library translation got deployed, but not the Overviews landing page.

@heathermiller
Copy link
Member

Thanks for your message. I'm most certainly aware of this.

I'm currently in the process of debugging. Your patch has a few issues (both layout and functionality-- e.g. you can no longer toggle to any other language, Japanese, Spanish, etc, from overview pages. It works only for overview-large pages. So other languages are currently, in effect, inaccessible)

And, as usual, github is having issues generating the site, which is why it's currently not live. It will be live when I commit some fixes.

@eed3si9n
Copy link
Member Author

The overview layout has been using overview attribute to correlate languages attribute:

    {% for pg in site.pages %}
      {% if pg.overview == page.overview and pg.languages %}
        {% assign languages = pg.languages %}
      {% endif %}
    {% endfor %}

But until this pull request overview posts like Futures writeup didn't actually contain overview attributes.

@eed3si9n
Copy link
Member Author

ok. I think I figured it out. It's a combo bug.

  1. I didn't put languages attributes on overview posts.
  2. overview layout is looping around site.pages, but the core writeups are actually in site.posts.

Adding languages attributes and the following change to the layout fixes it for me locally:

    {% for pg in site.posts %}
      {% if pg.overview == page.overview and pg.languages %}
        {% assign languages = pg.languages %}
      {% endif %}
    {% endfor %}

    {% for pg in site.pages %}
      {% if pg.overview == page.overview and pg.languages %}
        {% assign languages = pg.languages %}
      {% endif %}
    {% endfor %}

Should I send this as a pull req?

eed3si9n added a commit to scalajp/scala.github.com that referenced this pull request Nov 27, 2012
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.

2 participants