From fdf3995720d0b96770dadd800eff89c676eef5ba Mon Sep 17 00:00:00 2001 From: Pedro Filipe Martins Date: Tue, 6 Jul 2021 12:52:48 +0100 Subject: [PATCH] Add iso language proposal --- 0000-iso-language-code.md | 67 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 0000-iso-language-code.md diff --git a/0000-iso-language-code.md b/0000-iso-language-code.md new file mode 100644 index 0000000..4cb47ba --- /dev/null +++ b/0000-iso-language-code.md @@ -0,0 +1,67 @@ +- Start Date: 2021-07-06 +- RFC PR: (leave this empty) +- Svelte Issue: (leave this empty) + +# Template ISO language support + +## Summary + +By default the `app.html` includes `` but for localised pages need to replace the language used according to the context. + +## Motivation + +While building localised static pages, need to deliver correct language ISO on the html, to be SEO "friendly". +In the current setup to achieve the correct language code, all htmls files need to be parse and language code replace after the svelte build process is complete. + +## Detailed design + +### Technical Background + +> How do different libraries or frameworks implement this feature? We can take + +In other frameworks like [nextjs](https://nextjs.org/docs/advanced-features/custom-document) you can change the lang by doing + +``` +import { Html } from 'next/document'; + +``` + +### Implementation + +From my quick investigation could implemented something similar to `svelte:head` + +``` + + Home + +``` + +which replaces the string `%svelte.head%` from the template + +https://github.com/sveltejs/kit/blob/6ef148df0eeeb9c29d863906068ecf1494056158/packages/kit/src/core/build/index.js#L291 + +So something within the lines of + +``` +// app.html + +``` + +``` +/// page-to-render.svelte + +``` + +## How we teach this + +> What names and terminology work best for these concepts and why? How is this +idea best presented? As a continuation of existing Svelte patterns, or as a +wholly new one? + +About terminolagy guess is good to follow same pattern describe on [w3](https://www.w3.org/2005/05/font-size-test/starhtml-test.html) +Since there are clear ISO defined about the topic + +> How should this feature be introduced and taught to existing Svelte +users? + +Would take same approach for what is defined for svelte:head