-
Notifications
You must be signed in to change notification settings - Fork 6
Parse language information #3
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
Comments
Adding some issue references for related issues to make discovery easier: microformats/php-mf2#96 |
This is worth digging into for examples and variations on use of the Here's a clear example that shows some of the "gotchas": Bad example: <a lang="es" title="Spanish" href="qa-html-language-declarations.es">Español</a> vs. Good example: <span title="Spanish"><a lang="es" href="qa-html-language-declarations.es">Español</a></span> https://www.w3.org/International/questions/qa-html-language-declarations#contentvsattribute Hope that's helpful. It's research I was doing while discussing w3c/webmention#57 Cheers! |
That: Good example:
Seems like it could be improved with: Better(?) example:
Assuming that the document at "qa-html-language-declarations.es" is also in Spanish. |
@tantek could you code "fence" those so the markup's viewable? What I'm seeing in the console, though, does clarify the URL's meaning, but doesn't deal with <html lang="en">
...
Bestest(?) example:
<a title="Not actually in Spanish"
hreflang="jp" href="http://example.jp/"
lang="es">Español</a>
...
</html> That covers all the cases I know of...right now...today. 😜 |
I think I did? Took a few edits. markdown-- :P |
php-mf2 supports this behind a feature flag as of 0.3.2 https://github.com/indieweb/php-mf2/releases/tag/v0.3.2 microformat-shiv supports this as of 2.0 glennjones/microformat-shiv#22 Still pending confirmation from a consumer that this gives the expected result / no issues. |
Surely in the solutions the lang="en" part is fighting the goal of having the language option selectable by the Spanish speaker / reader? <span title="Español" lang="es">
<a hreflang="es" href="qa-html-language-declarations.es">Español</a>
</span> By making the title in the document language I'm pretty sure it will be inaccessible to assistive technologies. I'm pretty sure this is also where HTML starts to break down because if I've declared |
https://pin13.net/mf2/ and https://php.microformats.io have the |
This option is behind a flag, but no one has really implemented anything that uses this information extensively with the flag. This came up at the Microformats session today online and the question was asked as to whether enabling this by default would cause issues by changing the structure of the return. |
As discussed at the 2023 Nürnberg mf2 parsing issues session: this proposal should be expanded to apply to all properties, not just h-* and e-*. So, the following (contrived) HTML <article class="h-entry" lang="es">
<h1 class="p-name" lang="de">Der Artikel</h1>
<img class="u-featured" lang="fr" src="•••" alt="une image" />
<div class="e-content" lang="en-gb">On hindsight, it was foolish to mark this post up as being in Spanish, as it’s actually in English.</div> would parse to {
"items": [{
"type": ["h-entry"],
"lang": "es",
"properties": {
"name": [{"value": "Der Artikel", "lang": "de"}],
"featured": [{"value": "•••", "alt": "une image", "lang": "fr"}],
"content": [{
"value": "On hindsight, it was foolish to mark this post up as being in Spanish, as it’s actually in English."
"html": "On hindsight, it was foolish to mark this post up as being in Spanish, as it’s actually in English."
"lang": "en-gb"
}]
}
}]
} This should not present any back-compatibility issues to consumers, as any well-written consumer has to handle the case that every property value could be a string or an |
After discussion on IRC, opening an issue here for the language parsing brainstorming that's happened on the wiki:
http://microformats.org/wiki/microformats2-parsing-brainstorming#Parse_language_information
The text was updated successfully, but these errors were encountered: