Skip to content

Commit

Permalink
fix: improvements to localization, rebase conflicting changes
Browse files Browse the repository at this point in the history
  • Loading branch information
greatislander committed Jan 6, 2025
1 parent 1f8d710 commit dd8c85f
Showing 16 changed files with 129 additions and 53 deletions.
2 changes: 1 addition & 1 deletion .markdownlint-cli2.cjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
config: require("./node_modules/markdownlint-config-fluid/.markdownlintrc.json"),
ignores: ["node_modules", "src/collections", "CHANGELOG.md"]
ignores: ["node_modules", "src/collections/**/*.md", "CHANGELOG.md"]
};
4 changes: 2 additions & 2 deletions eleventy.config.js
Original file line number Diff line number Diff line change
@@ -11,11 +11,11 @@ export default function eleventy(eleventyConfig) {
eleventyConfig.addPlugin(fluidPlugin, {
defaultLanguage: "en",
supportedLanguages: {
"en-CA": {
en: {
slug: "en",
name: "English"
},
"fr-CA": {
fr: {
slug: "fr",
name: "Français",
dir: "ltr",
2 changes: 1 addition & 1 deletion src/_includes/layouts/base.njk
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@
{% if hasBanner %}
<div class="banner bg-{{ bannerBgColor }}">
<div class="banner__text">
<h1>{{ bannerTitle | safe }}</h1>
<h1>{{ bannerTitle | renderContent('md') | safe }}</h1>
{{ bannerBody }}
</div>
{% if bannerImage %}
3 changes: 1 addition & 2 deletions src/_includes/partials/components/navigation.njk
Original file line number Diff line number Diff line change
@@ -2,16 +2,15 @@
<div class="navigation__link">
<a class="navigation__home" href="/">{{ "<b>Inclusive</b><br>Standards" | safe }}</a>
{% set navItems = collections['pages_' + lang] | eleventyNavigation %}

<button class="navigation__toggle" id="navigation-toggle" aria-expanded="false">{% __ 'menu' %} {% include 'svg/menu.svg' %}</button>
</div>
<div class="navigation__menu" id="navigation-menu">
<ul>
{% for item in navItems %}
{% if locale == item.locale %}
<li>
<a href="{{ item.url }}">{{ item.key }}</a>
</li>
{% endif %}
{% endfor %}
</ul>
</div>
8 changes: 4 additions & 4 deletions src/_includes/partials/global/header.njk
Original file line number Diff line number Diff line change
@@ -8,10 +8,10 @@
<div class="header__settings">
<ul class="header__language" role="list">
<li>
<a href="{% if page.url == '/' %} /en/ {% else %} {{ page.url | replace("/fr/", "/en/") }} {% endif %}" lang="en-CA" hreflang="en-CA"{% if page.lang == 'en' %} aria-current="page"{% endif %}>English</a>
<a href="{{ page.url | locale_url('en') }}" lang="en" hreflang="en"{% if page.lang == 'en' %} aria-current="page"{% endif %}>English</a>
</li>
<li>
<a href="{% if page.url == '/' %} /fr/ {% else %} {{ page.url | replace("/en/", "/fr/") }} {% endif %}" lang="fr-CA" hreflang="fr-CA"{% if page.lang == 'fr' %} aria-current="page"{% endif %}>Français</a>
<a href="{{ page.url | locale_url('fr') }}" lang="fr" hreflang="fr"{% if page.lang == 'fr' %} aria-current="page"{% endif %}>Français</a>
</li>
</ul>
</div>
@@ -23,10 +23,10 @@
<div class="header__settings">
<ul class="header__language" role="list">
<li>
<a href="{% if page.url == '/' %} /en/ {% else %} {{ page.url | replace("/fr/", "/en/") }} {% endif %}" lang="en-CA" hreflang="en-CA"{% if page.lang == 'en' %} aria-current="page"{% endif %}>EN</a>
<a href="{% if page.url == '/' %} /en/ {% else %} {{ page.url | replace("/fr/", "/en/") }} {% endif %}" lang="en" hreflang="en"{% if page.lang == 'en' %} aria-current="page"{% endif %}>EN</a>
</li>
<li>
<a href="{% if page.url == '/' %} /fr/ {% else %} {{ page.url | replace("/en/", "/fr/") }} {% endif %}" lang="fr-CA" hreflang="fr-CA"{% if page.lang == 'fr' %} aria-current="page"{% endif %}>FR</a>
<a href="{% if page.url == '/' %} /fr/ {% else %} {{ page.url | replace("/en/", "/fr/") }} {% endif %}" lang="fr" hreflang="fr"{% if page.lang == 'fr' %} aria-current="page"{% endif %}>FR</a>
</li>
</ul>
</div>
16 changes: 16 additions & 0 deletions src/admin/admin.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
permalink: '/admin/index.html'
eleventyExcludeFromCollections: true
locale: en
---
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Content Manager</title>
</head>
<body>
<script src="https://unpkg.com/@sveltia/cms/dist/sveltia-cms.js"></script>
</body>
</html>
53 changes: 53 additions & 0 deletions src/admin/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
backend:
name: github
branch: main
repo: inclusive-design/standards.inclusivedesign.ca
base_url: https://auth.incd.ca
media_folder: src/assets/uploads
public_folder: /assets/uploads

editor:
preview: false
i18n:
locales: [en, fr]
default_locale: en

collections:
- label: Pages
label_singular: Page
name: pages
icon: article
i18n:
structure: multiple_folders
folder: src/collections/pages/
extension: md
create: true
fields:
- { label: Title, name: title, widget: string, i18n: true }
- { label: Navigation Order, name: order, widget: number, i18n: copy }
- { label: "Has Banner?", name: hasBanner, widget: boolean, i18n: copy }
- label: "Banner Background"
name: bannerBgColor
widget: select
options:
- label: Dark Grey
value: dark-grey
- label: Indigo 700
value: indigo-700
i18n: copy
required: false
- {
label: "Banner Title",
name: bannerTitle,
widget: string,
i18n: true,
required: false,
}
- {
label: "Banner Body",
name: bannerBody,
widget: string,
i18n: true,
required: false,
}
- { label: Body, name: body, widget: markdown, i18n: true }
16 changes: 12 additions & 4 deletions src/collections/pages/en/about.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
---
title: About
eleventyNavigation:
locale: en-CA
key: About
order: 1
layout: layouts/about
order: 1
hasBanner: true
bannerBgColor: dark-grey
bannerTitle: About
@@ -26,3 +23,14 @@ necessitatibus eligendi aut corrupti nisi quo voluptatum impedit. Nam dolor dele
cum libero provident est Quis voluptatem non ipsa ullam vel iure autem. Quo facilis reprehenderit in atque deleniti
qui facilis vitae sit officia galisum. Quo laboriosam consequatur sed fugit voluptas id quibusdam galisum sit
explicabo modi sit mollitia placeat hic laboriosam omnis.
=======
layout: layouts/about
---
## Making Standards Accessible

Lorem ipsum dolor sit amet. Ea galisum quisquam aut galisum aperiam eum dolores consequuntur et fugit rerum ut necessitatibus eligendi aut corrupti nisi quo voluptatum impedit. Nam dolor delectus non sapiente vero sit sint esse cum libero provident est Quis voluptatem non ipsa ullam vel iure autem. Quo facilis reprehenderit in atque deleniti qui facilis vitae sit officia galisum. Quo laboriosam consequatur sed fugit voluptas id quibusdam galisum sit explicabo modi sit mollitia placeat hic laboriosam omnis.

## What We Do

Lorem ipsum dolor sit amet. Ea galisum quisquam aut galisum aperiam eum dolores consequuntur et fugit rerum ut necessitatibus eligendi aut corrupti nisi quo voluptatum impedit. Nam dolor delectus non sapiente vero sit sint esse cum libero provident est Quis voluptatem non ipsa ullam vel iure autem. Quo facilis reprehenderit in atque deleniti qui facilis vitae sit officia galisum. Quo laboriosam consequatur sed fugit voluptas id quibusdam galisum sit explicabo modi sit mollitia placeat hic laboriosam omnis.
>>>>>>> a3333c6 (feat: some adjustments to localization approach)
3 changes: 1 addition & 2 deletions src/collections/pages/en/en.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{
"lang": "en",
"locale": "en-CA"
"lang": "en"
}
5 changes: 4 additions & 1 deletion src/collections/pages/en/index.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
---
title: Inclusive Standards
layout: layouts/home
order: 0
hasBanner: true
bannerBgColor: indigo-700
bannerTitle: <b>Inclusive</b> Standards
bannerTitle: "**Inclusive** Standards"
bannerBody: Inclusive Standards is a project led by the Inclusive Design Centre, dedicated to creating guidelines that ensure products, services, and environments are accessible and usable by everyone. We focus on promoting equity, diversity, and inclusion by developing standards that meet the needs of all individuals, including people with disabilities and marginalized communities.
layout: layouts/base
---
Not applicable.
10 changes: 4 additions & 6 deletions src/collections/pages/en/projects.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
---
title: Projects
eleventyNavigation:
locale: en-CA
key: Projects
order: 1
layout: layouts/projects
order: 2
hasBanner: true
bannerBgColor: dark-grey
bannerTitle: Projects
bannerBody: Projects showcase all the Inclusive Standards Projects currently being investigated by IDRC
---
layout: layouts/projects
---
Not applicable.
24 changes: 6 additions & 18 deletions src/collections/pages/fr/about.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,15 @@
---
title: À propos
eleventyNavigation:
locale: fr-CA
key: À propos
order: 1
layout: layouts/about
hasBanner: true
bannerBgColor: dark-grey
bannerTitle: About
bannerBody: Learn more about Inclusive standards
bannerTitle: À propos
bannerBody: En savoir plus sur les normes inclusives
---
## Making Standards Accessible
## Rendre les normes accessibles

Lorem ipsum dolor sit amet. Ea galisum quisquam aut galisum aperiam eum dolores consequuntur et fugit rerum ut
necessitatibus eligendi aut corrupti nisi quo voluptatum impedit. Nam dolor delectus non sapiente vero sit sint esse
cum libero provident est Quis voluptatem non ipsa ullam vel iure autem. Quo facilis reprehenderit in atque deleniti
qui facilis vitae sit officia galisum. Quo laboriosam consequatur sed fugit voluptas id quibusdam galisum sit
explicabo modi sit mollitia placeat hic laboriosam omnis.
Lorem ipsum dolor sit amet. Ea galisum quisquam aut galisum aperiam eum dolores consequuntur et fugit rerum ut necessitatibus eligendi aut corrupti nisi quo voluptatum impedit. Nam dolor delectus non sapiente vero sit sint esse cum libero provident est Quis voluptatem non ipsa ullam vel iure autem. Quo facilis reprehenderit in atque deleniti qui facilis vitae sit officia galisum. Quo laboriosam consequatur sed fugit voluptas id quibusdam galisum sit explicabo modi sit mollitia placeat hic laboriosam omnis.

## What do we do?
## Ce que nous faisons

Lorem ipsum dolor sit amet. Ea galisum quisquam aut galisum aperiam eum dolores consequuntur et fugit rerum ut
necessitatibus eligendi aut corrupti nisi quo voluptatum impedit. Nam dolor delectus non sapiente vero sit sint esse
cum libero provident est Quis voluptatem non ipsa ullam vel iure autem. Quo facilis reprehenderit in atque deleniti
qui facilis vitae sit officia galisum. Quo laboriosam consequatur sed fugit voluptas id quibusdam galisum sit
explicabo modi sit mollitia placeat hic laboriosam omnis.
Lorem ipsum dolor sit amet. Ea galisum quisquam aut galisum aperiam eum dolores consequuntur et fugit rerum ut necessitatibus eligendi aut corrupti nisi quo voluptatum impedit. Nam dolor delectus non sapiente vero sit sint esse cum libero provident est Quis voluptatem non ipsa ullam vel iure autem. Quo facilis reprehenderit in atque deleniti qui facilis vitae sit officia galisum. Quo laboriosam consequatur sed fugit voluptas id quibusdam galisum sit explicabo modi sit mollitia placeat hic laboriosam omnis.
3 changes: 1 addition & 2 deletions src/collections/pages/fr/fr.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{
"lang": "fr",
"locale": "fr-CA"
"lang": "fr"
}
8 changes: 6 additions & 2 deletions src/collections/pages/fr/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
---
title: Inclusive Standards
title: Normes inclusives
bannerTitle: Normes inclusives
bannerBody: Normes inclusives est un projet mené par la Centre de Recherche pour une Conception Inclusive, qui se consacre à l'élaboration de lignes directrices garantissant que les produits, les services et les environnements sont accessibles et utilisables par tous. Nous nous attachons à promouvoir l'équité, la diversité et l'inclusion en élaborant des normes qui répondent aux besoins de tous les individus, y compris les personnes handicapées et les communautés marginalisées.
layout: layouts/home
---
order: 0
---
Not applicable.
13 changes: 5 additions & 8 deletions src/collections/pages/fr/projects.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
---
title: Projets
eleventyNavigation:
locale: fr-CA
key: Projets
order: 1
layout: layouts/projects
hasBanner: true
bannerBgColor: dark-grey
bannerTitle: Projects
bannerBody: Projects showcase all the Inclusive Standards Projects currently being investigated by IDRC
---
bannerTitle: Projets
bannerBody: Les projets présentent tous les projets de normes inclusives actuellement étudiés par le CRDI.
layout: layouts/projects
---
Not applicable.
12 changes: 12 additions & 0 deletions src/collections/pages/pages.11tydata.js
Original file line number Diff line number Diff line change
@@ -3,5 +3,17 @@ import { generatePermalink } from "eleventy-plugin-fluid";
export default {
permalink: (data) => {
return generatePermalink(data, "pages");
},
eleventyComputed: {
eleventyNavigation: (data) => {
if (data.order === 0) {
return false;
}

return {
key: data.title,
order: data.order
};
}
}
};

0 comments on commit dd8c85f

Please sign in to comment.