# Problem in latest.rss / Not a Valid Feed, it says!

**URL:** <https://meta.discourse.org/t/problem-in-latest-rss-not-a-valid-feed-it-says/55466>\
**Category:** Support\
**Created:** [2017年一月10日 08:27 UTC](https://meta.discourse.org/t/problem-in-latest-rss-not-a-valid-feed-it-says/55466 "2017-01-10T08:27:59Z")\
**Posts on this page:** 13\
**Page:** 2

<div class="post-metadata">

**Author:** ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)\
**Post date:** [2017年一月14日 00:49 UTC](https://meta.discourse.org/t/problem-in-latest-rss-not-a-valid-feed-it-says/55466/23 "2017-01-14T00:49:24Z")

</div>

Did you wish to purchase a support contract? We prioritize paying customers.

You’ve bumped this twice now. Rather than bumping, I suggest you ask in #Marketplace, purchase a hosting plan, or be patient.

---

<div class="post-metadata">

**Author:** ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)\
**Post date:** [2017年一月14日 17:45 UTC](https://meta.discourse.org/t/problem-in-latest-rss-not-a-valid-feed-it-says/55466/24 "2017-01-14T17:45:49Z")

</div>

@codinghorror, I can now confirm this is happening due to the `default locale` being changed in Admin \> Settings. When I select Persian, it adds the `<language>fa_IR</language>` to the RSS feed output. Switching it back to English, puts it back to `<language>en</language>`.

Based on [List of ISO 639 language codes - Wikipedia](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes), it seems the appropriate code for Persian is simply `fa`, I’m not sure why `_IR` is being appended to it.

When I take the RSS output and plug it directly into the validator, changing `fa_IR` to `fa`, it marks it as Valid RSS.

With all that said, it seems this is a valid bug. I also confirmed using other languages (I choose at random, and have no idea what they were), were all using 2 character codes which made them valid as well.

Other locales that exhibit this same issue

- bs\_BA (should be bs?)
- fa\_IR (should be fa, per is also valid - ISO 639-2/B)
- nb\_NO (should be nb?)
- pl\_PL (should be pl?)
- pt\_BR (should be pt?)
- tr\_TR (should be tr?)
- zh\_CN (should be zh?)
- zn\_TW (should be zh?)

I wonder if the quick fix for this is to only take the first two characters for the `<language>` element in the RSS feed.

---

<div class="post-metadata">

**Author:** ![Arta\_S](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arta_s/32/537495_2.png) [@Arta\_S](https://meta.discourse.org/u/Arta_S)\
**Post date:** [2017年一月14日 18:12 UTC](https://meta.discourse.org/t/problem-in-latest-rss-not-a-valid-feed-it-says/55466/25 "2017-01-14T18:12:40Z")

</div>

This is persian language website that is having fa-IR tag in language and it seems working fine.

> **[همیاروردپرس](https://hamyarwp.com/feed/)**

---

<div class="post-metadata">

**Author:** ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)\
**Post date:** [2017年一月14日 18:50 UTC](https://meta.discourse.org/t/problem-in-latest-rss-not-a-valid-feed-it-says/55466/26 "2017-01-14T18:50:05Z")

</div>

Oh sweet, so another possible solution is replace \_ with - when writing out the RSS language element.

---

<div class="post-metadata">

**Author:** ![Arta\_S](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arta_s/32/537495_2.png) [@Arta\_S](https://meta.discourse.org/u/Arta_S)\
**Post date:** [2017年一月14日 19:02 UTC](https://meta.discourse.org/t/problem-in-latest-rss-not-a-valid-feed-it-says/55466/27 "2017-01-14T19:02:19Z")

</div>

Thank you.  
When you say replace \_ with a - , how do I have to do that?

---

<div class="post-metadata">

**Author:** ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)\
**Post date:** [2017年一月14日 19:27 UTC](https://meta.discourse.org/t/problem-in-latest-rss-not-a-valid-feed-it-says/55466/28 "2017-01-14T19:27:12Z")

</div>

I just submitted a PR for it  
[https://github.com/discourse/discourse/pull/4653](https://github.com/discourse/discourse/pull/4653)

---

<div class="post-metadata">

**Author:** ![Arta\_S](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arta_s/32/537495_2.png) [@Arta\_S](https://meta.discourse.org/u/Arta_S)\
**Post date:** [2017年一月14日 19:28 UTC](https://meta.discourse.org/t/problem-in-latest-rss-not-a-valid-feed-it-says/55466/29 "2017-01-14T19:28:27Z")

</div>

Thanks a bunch mate.

---

<div class="post-metadata">

**Author:** ![elijah](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/elijah/32/104055_2.png) [@elijah](https://meta.discourse.org/u/elijah)\
**Post date:** [2017年一月15日 07:22 UTC](https://meta.discourse.org/t/problem-in-latest-rss-not-a-valid-feed-it-says/55466/30 "2017-01-15T07:22:13Z")

</div>

> [@cpradio](#):
>
> Based on [List of ISO 639 language codes - Wikipedia](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes), it seems the appropriate code for Persian is simply fa, I’m not sure why \_IR is being appended to it.

Same reason we have `en`, `en-us`, `en-uk`, `en-au`, etc. The locale has potential changes based on country. You want a different spelling dictionary for `en-us` than `en-uk`. But as you observed later, the proper code uses a HYPHEN not an UNDERSCORE.

---

<div class="post-metadata">

**Author:** ![Arta\_S](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arta_s/32/537495_2.png) [@Arta\_S](https://meta.discourse.org/u/Arta_S)\
**Post date:** [2017年一月15日 10:36 UTC](https://meta.discourse.org/t/problem-in-latest-rss-not-a-valid-feed-it-says/55466/31 "2017-01-15T10:36:32Z")

</div>

> [@elijah](#):
>
> Same reason we have en, en-us, en-uk, en-au, etc. The locale has potential changes based on country. You want a different spelling dictionary for en-us than en-uk. But as you observed later, the proper code uses a HYPHEN not an UNDERSCORE.

Indeed correct!  
Because there are also other countries that speak their version of Persian (Farsi) and their language is fairly different.

---

<div class="post-metadata">

**Author:** ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)\
**Post date:** [2017年一月15日 14:09 UTC](https://meta.discourse.org/t/problem-in-latest-rss-not-a-valid-feed-it-says/55466/32 "2017-01-15T14:09:12Z")

</div>

> [@elijah](#):
>
> Same reason we have en, en-us, en-uk, en-au, etc. The locale has potential changes based on country. You want a different spelling dictionary for en-us than en-uk. But as you observed later, the proper code uses a HYPHEN not an UNDERSCORE.

Yeah, that makes sense. I just didn’t see any mention of that on the wiki page I found related to the RSS spec for language. It specifically stated to use ISO 639 and that wiki page didn’t make mention that a hyphen, country would be acceptable.

Do you know of a place that mentions that? Would love to read up on it more sometime in the near future. So any resources you may know, I’d love to bookmark them.

---

<div class="post-metadata">

**Author:** ![Arta\_S](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arta_s/32/537495_2.png) [@Arta\_S](https://meta.discourse.org/u/Arta_S)\
**Post date:** [2017年一月15日 15:50 UTC](https://meta.discourse.org/t/problem-in-latest-rss-not-a-valid-feed-it-says/55466/33 "2017-01-15T15:50:07Z")

</div>

@cpradio Thank you so much.

I just updated the core and its fixed now.  
fa-IR done the trick.

I really appreciate the effort and care you put in this

---

<div class="post-metadata">

**Author:** ![elijah](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/elijah/32/104055_2.png) [@elijah](https://meta.discourse.org/u/elijah)\
**Post date:** [2017年一月17日 18:24 UTC](https://meta.discourse.org/t/problem-in-latest-rss-not-a-valid-feed-it-says/55466/34 "2017-01-17T18:24:27Z")

</div>

> [@cpradio](#):
>
> Do you know of a place that mentions that? Would love to read up on it more sometime in the near future. So any resources you may know, I’d love to bookmark them.

RFC-4646, look for `langtag`.

> **[RFC 4646: Tags for Identifying Languages](https://datatracker.ietf.org/doc/html/rfc4646)**
>
> This document describes the structure, content, construction, and semantics of language tags for use in cases where it is desirable to indicate the language used in an information object. It also describes how to register values for use in language...

---

<div class="post-metadata">

**Author:** ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)\
**Post date:** [2023年五月21日 10:51 UTC](https://meta.discourse.org/t/problem-in-latest-rss-not-a-valid-feed-it-says/55466/38 "2023-05-21T10:51:40Z")

</div>



[上一頁](https://meta.discourse.org/t/problem-in-latest-rss-not-a-valid-feed-it-says/55466.md?page=1)
