Skip to content

Commit

Permalink
localization: improve website localization
Browse files Browse the repository at this point in the history
  • Loading branch information
meh committed Jun 7, 2011
1 parent 65513f1 commit 3fd7dd9
Show file tree
Hide file tree
Showing 24 changed files with 124 additions and 94 deletions.
14 changes: 14 additions & 0 deletions _includes/menu.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{% case page.lang %}
{% when 'it' %}
<a href="/">Home</a>
<a href="/it/docs/">Documentazione</a>
<a href="/it/contributing.html">Contribuisci</a>
<a href="/it/about.html">Informazioni</a>

{% else %}
<a href="/">Home</a>
<a href="/en/docs">Documentation</a>
<a href="/en/contributing.html">Contributing</a>
<a href="/en/about.html">About</a>

{% endcase %}
12 changes: 12 additions & 0 deletions _includes/stub.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{% case page.lang %}
{% when 'it' %}
<div class="warning">Questa pagina è un <b>abbozzo</b>,
<a href="/it/contributing.html#documentation">aiuta</a> ad espanderla e sistemarla.
</div>

{% else %}
<div class="warning">This page is a <b>stub</b>, please
<a href="/en/contributing.html#documentation">help</a> expanding and cleaning it.
</div>

{% endcase %}
54 changes: 45 additions & 9 deletions _layouts/default.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
---
languages:
- code: en
- code: it
---

<!DOCTYPE html>
<html>
<head>
Expand Down Expand Up @@ -30,7 +36,7 @@

<body>
<div id="container">
<a href="/"><div id="header" style="text-align: center; margin: 0; padding: 0;">
<div id="header"><a href="/"><div style="text-align: center; margin: 0; padding: 0;">
<div style="height: 143px; font-size: 12px; min-width: 760px; max-width: 800px; margin: 0 auto; font-weight: bold;">

<div style="font-size: 123px; float: left;">Distr<img src="/images/logo_cropped_blur.png" style="height: 0.6em; position: relative; top: 5px;"></div>
Expand All @@ -48,18 +54,48 @@
<span style="font-size: 18px; float: left; margin-top: 10px; margin-left: 10px;">Distribution</span>
</div>
</div>
</div></a>

<div style="clear: both;"></div>
</div></a></div>

{% unless page.unlocalized %}<div id="languages">
{% for language in page.languages %}
{% assign code = language.code %}

{% if language.name %}
{% assign name = language.name %}
{% else %}
{% assign name = code %}
{% endif %}

{% unless page.lang %}
{% capture page.lang %}en{% endcapture %}
{% endunless %}

{% capture old_prefix %}/{{ page.lang }}/{% endcapture %}
{% capture new_prefix %}/{{ code }}/{% endcapture %}

<span class="language">
<a href="{{ page.url | replace_first: old_prefix, new_prefix }}"
{% if page.lang == code %}
class="current"
{% endif %}
>{{ name }}</a>
</span>
{% endfor %}
</div>{% endunless %}

<div id="menu">
<a href="/">Home</a>
<a href="/docs/en/">Documentation</a>
<a href="/docs/en/contributing.html">Contributing</a>
<a href="/about.html">About</a>
{% include menu.html %}
</div>

<div id="content">{{ content }}</div>
<div id="content">
<div class="types">
{% if page.stub %}
{% include stub.html %}
{% endif %}
</div>

{{ content }}
</div>

{% if page.comments %}
<div id="disqus_thread">
Expand Down
44 changes: 0 additions & 44 deletions _layouts/documentation.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,52 +3,8 @@

comments: true
license: meh-cc

languages:
- code: en
- code: it
---

<div class="languages">
{% if page.stub %}
{% case page.lang %}

{% when 'en' %}
<div class="warning">This page is a <b>stub</b>, please
<a href="/docs/en/contributing.html#documentation">help</a> expanding and cleaning it.
</div>

{% when 'it' %}
<div class="warning">Questa pagina è un <b>abbozzo</b>,
<a href="/docs/it/contributing.html#documentation">aiuta</a> ad espanderla e sistemarla.
</div>

{% endcase %}
{% endif %}

{% for language in page.languages %}
{% assign code = language.code %}

{% if language.name %}
{% assign name = language.name %}
{% else %}
{% assign name = code %}
{% endif %}

{% capture old_prefix %}/docs/{{ page.lang }}/{% endcapture %}
{% capture new_prefix %}/docs/{{ code }}/{% endcapture %}

<span class="language">
<a href="{{ page.url | replace_first: old_prefix, new_prefix }}"
{% if page.lang == code %}
class="current"
{% endif %}
>{{ name }}</a>
</span>
{% endfor %}
</div>


<div class="documentation">
{{ content }}
</div>
1 change: 1 addition & 0 deletions _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
layout: default

comments: true
unlocalized: true
---

<div class="post">
Expand Down
2 changes: 1 addition & 1 deletion css/default.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 22 additions & 16 deletions css/default.scss
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,28 @@ ul.contents {
padding-bottom: 10px;

#header {
color: black !important;
cursor: default !important;
a {
color: black !important;
cursor: default !important;
}
}

#languages {
position: fixed;
top: 2px;
right: 5px;

text-align: right;
padding-bottom: 4px;

.language {
margin-left: 5px;
padding: 0;

a.current {
border-bottom: 2px solid black;
}
}
}

#menu {
Expand Down Expand Up @@ -105,20 +125,6 @@ ul.contents {
border-bottom: 1px dotted black;
}

.languages {
text-align: right;
padding-bottom: 4px;

.language {
margin-left: 5px;
padding: 0;

a.current {
border-bottom: 2px solid black;
}
}
}

.warning {
margin-top: 5px;
color: #b21818;
Expand Down
2 changes: 2 additions & 0 deletions about.md → en/about.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
title: About Distrø
layout: default

lang: en
---

Distrø aims to be **THE** distribution.
Expand Down
8 changes: 4 additions & 4 deletions docs/en/contributing.md → en/contributing.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Contributing to Distrø
layout: documentation
layout: default

lang: en
stub: true
Expand Down Expand Up @@ -41,7 +41,7 @@ or howtos or whatever, just open an issue or come into [IRC](#irc)

Translating
-----------
Translations are needed, to do it simply copy the `docs/en` directory to `docs/<yourlanguage>`
Translations are needed, to do it simply copy the `en/docs` directory to `<yourlanguage>/docs`
and start translating the contents, remember to keep the file names the same or stuff will go deeply
wrong.

Expand All @@ -61,7 +61,7 @@ can be of huge help. All the stuff of Distrø is Ruby driven, because Ruby is
Rbuild writing
--------------
Being a young project with a new package manager this means tons of packages are missing,
it's really easy to write rbuils, so head to the [quickstart](/docs/packo/quickstart.html) and
it's really easy to write rbuils, so head to the [quickstart](/en/docs/packo/quickstart.html) and
start writing rbuilds for your favourite packages. As usual coordination on [IRC](#irc) or through
issues is advised (and wanted).

Expand All @@ -83,7 +83,7 @@ aren't a dick you will become trusted :)
Package manager writing
-----------------------
If you think the package manager misses a feature or a module head to the
[packø development](/docs/packo/development/index.html) page and come to [IRC](#irc) to start
[packø development](/en/docs/packo/development/index.html) page and come to [IRC](#irc) to start
contributing to the package manager.

<p><center>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
17 changes: 8 additions & 9 deletions docs/en/index.md → en/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ detailed, up to date technical content.

Contributors
------------
Contributions are encouraged. See the [contributing](/docs/en/contributing.html#documentation) section for how to get started.
Contributions are encouraged. See the [contributing](/en/contributing.html#documentation) section for how to get started.

If you have any corrections, suggestions or improvements please open an issue
[here](https://github.com/distro/distro.github.com/issues).
Expand All @@ -26,11 +26,10 @@ Contents
--------

{:class="contents"}
* [Contributing](/docs/en/contributing.html#documentation)
* [General concepts](/docs/en/general-concepts/index.html)
* + [Packages](/docs/en/general-concepts/packages.html)
* + [Repositories](/docs/en/general-concepts/repositories.html)
* + [Profiles](/docs/en/general-concepts/profiles.html)
* [Packø](/docs/en/packo/index.html)
* + [Quickstart Rbuild Guide](/docs/en/packo/quickstart.html)
* + [Building Systems](/docs/en/packo/building-systems.html)
* [General concepts](/en/docs/general-concepts/index.html)
* + [Packages](/en/docs/general-concepts/packages.html)
* + [Repositories](/en/docs/general-concepts/repositories.html)
* + [Profiles](/en/docs/general-concepts/profiles.html)
* [Packø](/en/docs/packo/index.html)
* + [Quickstart Rbuild Guide](/en/docs/packo/quickstart.html)
* + [Building Systems](/en/docs/packo/building-systems.html)
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 5 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
---
title: Distrø
layout: default
lang: en

tweets: 7

layout: default
unlocalized: true
---

<div id="posts">
{% for post in site.posts limit:1 %}
{% for post in site.posts limit:3 %}
<div class="post">
<div class="header"><h2>
<a href="{{ post.url }}">{{ post.title | format_text }}</a>
Expand Down
File renamed without changes.
File renamed without changes.
19 changes: 10 additions & 9 deletions docs/it/index.md → it/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ L'intento e' di fare un a handbook per dare dettagli tecnici.

Contribuenti
------------
Coloro che vogliono contribuire sono ben accetti. Date un'occhiata alla sezione [contributing](/docs/it/contributing.html#documentation) per capire come iniziare.
Coloro che vogliono contribuire sono ben accetti. Date un'occhiata alla sezione
[contributing](/it/contributing.html#documentation) per capire come iniziare.

Se avete qualche correzione, suggerimento o miglioramento aprite una issue
[qui](https://github.com/distro/distro.github.com/issues).
Expand All @@ -25,11 +26,11 @@ Contents
--------

{:class="contents"}
* [Contribuire](/docs/it/contributing.html#documentation)
* [Concetti Generali](/docs/it/general-concepts/index.html)
* + [Pacchetti](/docs/it/general-concepts/packages.html)
* + [Repositories](/docs/it/general-concepts/repositories.html)
* + [Profili](/docs/it/general-concepts/profiles.html)
* [Packø](/docs/it/packo/index.html)
* + [Guida veloce alle RBuild](/docs/it/packo/quickstart.html)
* + [Sistemi di Costruzione](/docs/it/packo/building-systems.html)
* [Contribuire](/it/docs/contributing.html#documentation)
* [Concetti Generali](/it/docs/general-concepts/index.html)
* + [Pacchetti](/it/docs/general-concepts/packages.html)
* + [Repositories](/it/docs/general-concepts/repositories.html)
* + [Profili](/it/docs/general-concepts/profiles.html)
* [Packø](/it/docs/packo/index.html)
* + [Guida veloce alle RBuild](/it/docs/packo/quickstart.html)
* + [Sistemi di Costruzione](/it/docs/packo/building-systems.html)
File renamed without changes.
File renamed without changes.

0 comments on commit 3fd7dd9

Please sign in to comment.