hreflang

This forum is for all Flare issues related to the HTML5, WebHelp, WebHelp Plus, and Adobe Air Targets
Post Reply
bianca_writer
Propeller Head
Posts: 54
Joined: Tue Mar 15, 2016 9:57 am
Location: Los Angeles, CA

hreflang

Post by bianca_writer »

I generate HTML5 output in multiple languages. Google recommends including the hreflang attribute to direct users to the content appropriate for their language/region. Google explains that there are a few ways to incorporate the hreflang attribute: https://support.google.com/webmasters/a ... 9077?hl=en

Has anyone used hreflang? If so, do you add it to the <head> section of your master pages? It looks like I could also add it to the sitemap, but I think I'd have to do that manually every time I build the HTML target.
AlexFox
Sr. Propeller Head
Posts: 162
Joined: Thu Oct 19, 2017 1:56 am

Re: hreflang

Post by AlexFox »

Do you have one target per language? If so I'd use the meta tags option in the target itself.
bianca_writer
Propeller Head
Posts: 54
Joined: Tue Mar 15, 2016 9:57 am
Location: Los Angeles, CA

Re: hreflang

Post by bianca_writer »

Hi Alex,

Great tip! However, I copied the text into the "Add meta tags to content" field, and I got an "Invalid XML" warning from Flare. When I build the target, the code doesn't show up in the <head> section. Any idea why Flare wouldn't support the code? I'm using the format that Google says to use:

<link rel="alternate" hreflang="es" href="http://es.example.com/" />

Once again, this is the page from Google: https://support.google.com/webmasters/a ... 9077?hl=en
AlexFox
Sr. Propeller Head
Posts: 162
Joined: Thu Oct 19, 2017 1:56 am

Re: hreflang

Post by AlexFox »

Seems I gave you duff advice and Flare enforces these tags beginning with "<meta", sorry about that.

MasterPages will work fine for this, especially if you always have a Spanish (for example) equivalent page. You could get a little clever with the href link and some variables if you wanted to, but you'd only need to do this if the language you translated into varied from time to time, which I doubt.
bianca_writer
Propeller Head
Posts: 54
Joined: Tue Mar 15, 2016 9:57 am
Location: Los Angeles, CA

Re: hreflang

Post by bianca_writer »

Hi Alex,

No worries! I'm glad you brought up the "Add meta tags.." field, because I didn't realize that option even existed. I might be able to put it to good use!

Also, I submitted a feature request, asking that MadCap expands the type of code allowed in the "Add meta tags..." field, so that other code could be added.

Thanks,
Bianca
Post Reply