Skip to content

Commit

Permalink
add Italian demo page; improve templating
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchellevan committed Jan 11, 2025
1 parent ff66fb7 commit 75f4f39
Show file tree
Hide file tree
Showing 4 changed files with 236 additions and 6 deletions.
14 changes: 9 additions & 5 deletions contributing/lang-maintenance.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,32 @@ Translations are best-effort. If it's too hard to translate, leave it like "[? C

* Language — Something that speakers or linguists identify as a distinct language. These instructions call it the "target language."
* Country — A country associated with the target language.
* Locale — The locale could be the same as the country. Or it could be a region that's associated with the target language within the country. (Example: Some people speak Lower Sorbian in the city of [Cottbus, Germany](lang/dsb.html).)
* Locale — The locale could be the same as the country. Or it could be a region that's associated with a target language within the country. (Example: Some people speak Lower Sorbian in the city of [Cottbus, Germany](../lang/dsb.html).)
* Script (optional) — An alternate writing system.
* Language code: Usually just the two- or three-character IANA language code. We don't add the country, locale, or script unless it's important to distinguish the form of the target language.

## Adding a page

* Copy a stub language page the template HTML. Name the file with the language code.
* Add it to the [list of language pages](lang-pages.md).
* Add it to the [list of language pages](../lang-pages.md).
* Copy a stub results page from the template HTML. Name the file with the language code.
* Add it to the [list of test results](research/lang-results.md).
* Add it to the [list of test results](../research/lang-results.md).
* In the individual results page, fill the "Creating the test page" section as you go.

## Navigation

* Copy the flag icon character from [Emoji flags (Wikipedia)](https://en.wikipedia.org/wiki/Regional_indicator_symbol#Emoji_flag_sequences).
* Alphabetize it by flag code, link language, and URL language — in other words, alphabetize the lines of HTML code in the list. Mainly this groups languages by country.

## Translation

The file lang-strings.txt contains the directly translatable strings, which is convenient for machine translation. For human translation, you can work in the (lang).html file directly for better context.

## Table of opening hours

* Confirm the week starts on Monday in this country. Example: [Calendar for Year 2024 (Antigua and Barbuda) - TimeAndDate](https://www.timeanddate.com/calendar/?year=2024&country=221)
* Put the later hours on a random day of the week. (So we can ask participants a usability question about the table: When is the library open later?)
* Localize the time range with the [Date and Time Localizer](utility/date-time-localizer.html) tool. But don't trust the dash character: see <a href="https://github.com/ThePacielloGroup/babel/issues/38">issue 38</a>.
* Localize the time range with the [Date and Time Localizer](../utility/date-time-localizer.html) tool. But don't trust the dash character: see <a href="https://github.com/ThePacielloGroup/babel/issues/38">issue 38</a>.

## List of links: Web pages in the target language

Expand All @@ -47,7 +51,7 @@ Include a government webpage in the target language. In order of preference:

Google Translate:

1. Try https://translate.google.com/?hl=xx substituting the language code.
1. Try https://translate.google.com/?hl=xxx substituting the language code.
1. For the link text, use Google's own localized name for the Google Translate page.
1. If Google supports translation in the target language, but the Google Translate page itself is not localized in the target language, then link to the Google Translate page localized in the national language for the country. Note the national language as "([LANGUAGE], <code>[LANGUAGE CODE]</code>)" after the link.
1. "🙅 Google Translate": this indicates that Google does not support translation in the target language. In this context, do not translate this phrase and do not give it a <code>lang</code> attribute.
Expand Down
30 changes: 30 additions & 0 deletions contributing/lang-strings.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[? Calabria - Italian]
[? Welcome to Calabria]
[? Some people speak Italian here.]
[? Library]
[? Ask a librarian about Italian.]
[? Ask the library staff about Italian.] ((gender-neutral))
[? Opening hours of the library]
[? Day]
[? Day of the week] ((more specific))
[? Hours]
[? Opening hours] ((more specific))
[? Monday]
[? Tuesday]
[? Wednesday]
[? Thursday]
[? Friday]
[? Saturday]
[? Sunday]
[? closed]
[? We had a special celebration on July 1, 2024.]
[? Web pages in Italian]
[? Wikipedia]
[? Government] ((if needed))
[? Web pages in other languages]
[? Universal Declaration of Human Rights] ((copy this from the source))
[? Article 2] ((copy this from the source))
[? Feedback]
[? How can we make this website better?]
[? Submit]
[? "Submit" button in a web form] ((context))
2 changes: 1 addition & 1 deletion lang/_template.html
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ <h2>[? Web pages in [LANGUAGE]]</h2>
<li><a href="...">[? Google Translate]</a></li>
<!-- -->
<!-- en: Web Content Accessibility Guidelines (WCAG) -->
<li><a href="...">[? WCAG]</a></li>
<li><a href="...">[? WCAG] (WCAG) 2.2</a></li>
<li>🙅 WCAG [? 2.2]</li>
</ul>

Expand Down
196 changes: 196 additions & 0 deletions lang/it.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
<!DOCTYPE html>
<html lang="it">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- -->
<!-- en: Calabria - Italian -->
<title>Calabria - Italiano</title>
<link rel="stylesheet" href="../simple.css">
<link rel="stylesheet" href="../site.css">
<link rel="stylesheet" href="lang.css">
<script src="lang.js"></script>
</head>

<body>
<nav>
<details class="place-nav">
<summary lang="en"><span class="locale-widget-icon" aria-hidden="true">🌐</span>Location and Language</summary> <!-- English for the demo. Should be the user's preferred language. -->
<ul>
<li><span class="flag">🇦🇬</span> <a lang="en" href="en.html">Antigua and Barbuda - English</a></li>
<li><span class="flag">🇩🇪</span> <a lang="de" href="de.html">Deutschland - Deutsch</a></li>
<li><span class="flag">🇩🇪</span> <a lang="dsb" href="dsb.html">Chóśebuz, Nimska - Dolnoserbšćina</a></li>
<li><span class="flag">🇪🇸</span> <a lang="es" href="es.html">España - Español</a></li>
<li><span class="flag">🇮🇩</span> <a lang="jv" href="jv.html">Indonesia - Basa Jawa</a></li>
<li><span class="flag">🇮🇹</span> <a lang="it" href="it.html" aria-current="page">Calabria - Italiano</a></li>
</ul>
</details>
</nav>
<main>
<!-- -->
<!-- en: Welcome to Calabria -->
<h1><span class="flag">🇮🇹</span> Benvenuti in Calabria</h1>

<!-- -->
<!-- en: Some people speak Italian here. -->
<p>Qui c'è chi parla italiano.</p>

<!-- -->
<!-- en: Library -->
<h2>Biblioteca</h2>

<!-- -->
<!-- en: Ask a librarian (gender-neutral) about Italian. -->
<p>Chiedi al personale della biblioteca informazioni sull'italiano.</p>

<table>
<!-- -->
<!-- en: Opening hours of the library -->
<caption>Orari di apertura della biblioteca</caption>
<tr>
<!-- -->
<!-- en: Day (of the week) -->
<th>Giorno</th>
<!-- -->
<!-- en: Hours -->
<th>Orari</th>
</tr>
<tr>
<!-- -->
<!-- en: Monday -->
<th>Lunedì</th>
<td>09:00 – 17:00</td>
</tr>
<tr>
<th>Martedì</th>
<td>12:00 – 20:00</td>
</tr>
<tr>
<th>Mercoledì</th>
<td>09:00 – 17:00</td>
</tr>
<tr>
<th>Giovedì</th>
<td>09:00 – 17:00</td>
</tr>
<tr>
<th>Venerdì</th>
<td>09:00 – 17:00</td>
</tr>
<tr>
<th>Sabato</th>
<!-- -->
<!-- en: closed -->
<td>Chiuso</td>
</tr>
<tr>
<th>Domenica</th>
<td>Chiuso</td>
</tr>
</table>

<!-- -->
<!-- en: We had a special celebration on 2024-07-01. -->
<p>Abbiamo avuto una festa speciale il 1° luglio 2024.</p>

<!-- -->
<!-- en: Web pages in Italian -->
<h2>Pagine Web in italiano</h2>
<ul>
<!-- -->
<!-- en: Wikipedia: Calabria -->
<li><a href="https://it.wikipedia.org/wiki/Calabria">Wikipedia: Calabria</a></li>
<!-- -->
<!-- en: Wikipedia: Italian language -->
<li><a href="https://it.wikipedia.org/wiki/Lingua_italiana">Wikipedia: Lingua italiana</a></li>
<!-- -->
<!-- en: [TITLE OF GOVERNMENT WEBPAGE] -->
<!-- OMITTED -->
<!-- -->
<!-- en: Google Translate -->
<li><a href="https://translate.google.com/?hl=it">Google Traduttore</a></li>
<!-- -->
<!-- en: Web Content Accessibility Guidelines (WCAG) 2.2 -->
<li><a href="https://www.w3.org/Translations/WCAG22-it/">Linee guida per l'accessibilità dei contenuti Web (WCAG) 2.2</a></li>
</ul>

<!-- -->
<!-- en: Web pages in other languages -->
<h2>Pagine Web in altre lingue</h2>

<ul>
<!-- -->
<!-- en: Wikipedia: Calabria (Sicilian, scn) -->
<li lang="scn"><a href="https://scn.wikipedia.org/wiki/Calabbria">Wikipedia: Calabbria</a> (Sicilianu, <code>scn</code>)</li>
<!-- -->
<!-- en: Wikipedia: Calabria (Neapolitan, nap) -->
<li lang="nap"><a href="https://nap.wikipedia.org/wiki/Calavria">Wikipedia: Calavria</a> (Napulitano, <code>nap</code>)</li>
<li>https://incubator.wikimedia.org/wiki/Wp/aae/Gljuha_arb%C3%ABreshe</li>
<!-- -->
<!-- en: [TITLE OF GOVERNMENT WEBPAGE] -->
<!-- OMITTED -->
<!-- -->
<!-- en: Web Content Accessibility Guidelines (WCAG) -->
<li lang="scn">🙅 WCAG (Sicilianu, <code>scn</code>)</li>
<li lang="nap">🙅 WCAG (Napulitano, <code>nap</code>)</li>
<li lang="en"><a href="https://www.w3.org/TR/WCAG22/">Web Content Accessibility Guidelines (WCAG) 2.2</a> (English, <code>en</code>)</li>
</ul>

<!-- -->
<!-- en: Universal Declaration of Human Rights -->
<h2>Dichiarazione universale dei diritti umani</h2>

<div>
<!-- -->
<!-- en: Article 1 (normally 2) -->
<h3>Articolo 1</h3>

<blockquote>
<p>Tutti gli esseri umani nascono liberi ed eguali in dignità e diritti. Essi sono dotati di ragione e di coscienza e devono agire gli uni verso gli altri in spirito di fratellanza.</p>
<p><a href="https://www.ohchr.org/en/human-rights/universal-declaration/translations/italian">Dichiarazione universale dei diritti umani</a></p>
</blockquote>
</div>

<div lang="es">
<h3>Artículo 1 (Español, <code>es</code>)</h3>

<blockquote>
<p>Todos los seres humanos nacen libres e iguales en dignidad y derechos y, dotados como están de razón y conciencia, deben comportarse fraternalmente los unos con los otros.</p>
<p><a href="https://www.ohchr.org/en/human-rights/universal-declaration/translations/spanish">Declaración Universal de Derechos Humanos</a></p>
</blockquote>
</div>

<div lang="fr">
<h3>Article premier (français, <code>fr</code>)</h3>

<blockquote>
<p>Tous les êtres humains naissent libres et égaux en dignité et en droits. Ils sont doués de raison et de conscience et doivent agir les uns envers les autres dans un esprit de fraternité.</p>
<p><a href="https://www.ohchr.org/en/human-rights/universal-declaration/translations/french">Déclaration universelle des droits de l'homme</a></p>
</blockquote>
</div>

<!-- -->
<!-- en: Feedback -->
<h2>Feedback</h2>

<form>
<!-- -->
<!-- en: How can we make this website better? -->
<label for="feedback">Come possiamo migliorare questo sito web?</label><br>
<textarea id="feedback" cols="60" rows="4"></textarea><br>
<!-- -->
<!-- en: Submit -->
<input type="submit" value="Invia" onclick="alert('This demo does not submit anything. If you want, you can copy your feedback into an email to Mitchell.'); return false;">
</form>
</main>

<footer lang="en">
<p>Your browser language preferences: <span id="lang-prefs">(script needed)</span></p>
<p>This page does not use cookies or logging.</p>
<p><a href="...">Test results for Italian</a></p>
</footer>

</body>

</html>

0 comments on commit 75f4f39

Please sign in to comment.