Skip to content
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

Support of language attribute through xml:lang #54

Open
Lonami opened this issue Sep 10, 2021 · 3 comments
Open

Support of language attribute through xml:lang #54

Lonami opened this issue Sep 10, 2021 · 3 comments

Comments

@Lonami
Copy link

Lonami commented Sep 10, 2021

Hi, nice project. I was wondering if it would be possible to either support user-defined attributes on the <feed> and <entry> tags, such as xml:lang="en", or maybe it would be best to have a "lang" ("language"?) field somewhere (in Feed and Entry).

The xml:lang attribute is mentioned in Introduction to Atom - About this document which links to 2.12 Language Identification. Static Site Generators such as Zola also make use of this attribute (but I'd like to move away from it), so it would be nice if this crate somehow offered the possibility of setting the document's language. In the future, we could also decide what to do with the hreflang attribute.

I took a look at both the documentation and the code, but as far as I can tell, I'm only able to define namespaces and not actually arbitrary attributes for the <feed> tag. Thank you.

@andy128k
Copy link
Member

xml:lang is already supported by this crate in <content> tags and text fields in general.

@Lonami
Copy link
Author

Lonami commented Sep 10, 2021

Ah, my bad, I missed that. Would it be worthwhile to put it in Feed as well, or does having it there make not much sense?

@andy128k
Copy link
Member

It depends on the pattern of usage of the crate. If you create a feed, it makes less sense. OTOH if you consume a feed and care about language, you may miss it, so it makes a lot of sense.

While Atom spec allows to have xml:lang and xml:base on ANY element (e.g. <category>), my judgement is that it is a must to support them in a <feed> tag and less important to support in other tags.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants