Language settings fix in UIKit

I was struggling with the language site/page settings in RW for quite some time until I finally found the issue why RW is not correctly setting the page language in the code: as soon as there is a language attribute within the html tag of a template, RW does not touch this and leaves the language as specified in the template.

@Lucas it seems you try to fix this within UIKit by modifying the DOM afterwards using the language setting from the Customizer stack. Even though this might fix the issue in the browser, it does not when it comes to search engines as they do not render a page. So, the JS does not work in this case.

The correct fix would be to delete the lang=“en-uk” attribute from the UIKit template and all of a sudden everything works fine. Unfortunately at this point UIKit is still overwriting the now working RW setting and I have to set the language in RW as well as in UIKit.

You should definitely change the UIKit template as suggested (have done this already locally) and either remove the language setting in the Customizer or have a default setting for the language that simply does not overwrite the RW setting.

I hope this was not too confusing :)

Interesting never had an issue with languages before. Will have to run some tests and get back to you as soon as I reproduce this issue.

Thanks. I let RMS already know about this issue in parallel as they should actually fix this by being able to overwrite the language in a template in the first place. You just never know when they provide that fix in the final product :) Btw, your language settings might still be useful until RMS has fixed the issue all together, as changing the language on a page only works during a session. After closing and opening the project again, all those page specific settings are gone and have to be redone in case you need to publish the site again.