Expression Web 2 is inserting <span lang=" en-us" > anytime I type any changes
I noticed that everytime I edit text in Expression web, it automatically inserts <span lang=" en-us" > around the text that is being edited. I've looked up the problem and suggestions say to change the default encoding and other things. No matter what I do, it still inserts this. Please help. Thanks. Jim
Answers
- You get this when you do not specify a language for your html. Add the language to your html element
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
Or put in the following meta element:
<meta http-equiv="content-language" content="en" />
That way it won't keep trying to make your text match your keyboard settings.
MS MVP Expression- Marked As Answer byLori DirksMSFT, ModeratorSunday, November 23, 2008 7:09 AM
- With the site open, click Site > Site Settings,
on the Site Settings dialog click the Advanced tab,
Check "Ignore the keyboard when deciding the encoding of new pages."
and click OK.
See if it helps
FrontPage MVP- Marked As Answer byLori DirksMSFT, ModeratorSunday, November 23, 2008 7:09 AM
All Replies
- In your settings, do you have:
Server Message Language = english (united states)
Default Page Encoding = UTF-8
? - You get this when you do not specify a language for your html. Add the language to your html element
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
Or put in the following meta element:
<meta http-equiv="content-language" content="en" />
That way it won't keep trying to make your text match your keyboard settings.
MS MVP Expression- Marked As Answer byLori DirksMSFT, ModeratorSunday, November 23, 2008 7:09 AM
- Can i disable this thing. I need both english and cyrillic symbols in html page for my CMS. And this is really annoing everytime delete spans
- Set the page language to the one you use the most on the page. Then wrap the other language in a span,dir or other html element.
<div lang="Cyrl" xml:lang="Cyrl">
That is better semantics.
MS MVP Expression - I'm sorry to say, but this doesn't help.
All my pages are based on two different master pages - one has language set to "en", and the other to "da". It doesn't make any difference at all.
I did some searching on the net and nobody seems to have an answer (or an explanation). Some recommends checking or unchecking the "Ignore The Keyboard When
Deciding The Encoding Of New Pages" checkbox (Site -> Site Settings -> Language) and checking or unchecking the "Automatically switch keyboard to match language of surrounding text" (Tools -> Page Editor Options).
This seems to fix it for a few but makes no difference to most.
I tried checking/unchecking both and for me it makes no difference.
Personally I can live with it, since it only inserts that annoying <span> in Design View, and I do all my work in Code View.
Had I been using Design View I would be utterly frustrated!
/MrMox - With the site open, click Site > Site Settings,
on the Site Settings dialog click the Advanced tab,
Check "Ignore the keyboard when deciding the encoding of new pages."
and click OK.
See if it helps
FrontPage MVP- Marked As Answer byLori DirksMSFT, ModeratorSunday, November 23, 2008 7:09 AM
- Hi Steve,
If the advice was meant for me, then (like I mention in my post) it makes no difference at all.
Since I'm not that much bothered by it (I'm editing in Code View), I don't want to experiment too much.
The reason is that last time I did, checking and/or unchecking the two textboxes I mention also seemed to influence another problem of mine - EW not being able to show special characters correctly (but let's leave that problem to another thread in order to keep this one focused).
Point is, that no checking/unchecking of these checkboxes made any difference.
/MrMox - Just to clarify: I'm using EW1
(but the 'feature' is apparently still there in EW2...)
/MrMox - Not showing characters correctly is almost always a characterset issue. UTF-8 works best but if you are working on a PHP site in v1 then that isn't an option available since it triggers the BOM problem.
MS MVP Expression - i'm making flags for cms, they will be replaced by modules while generating the page. I need something like [Модуль], but with spans php doesn't recognise it. Is there any way to disable this?
- MrMox, this almost drove me crazy as well until I went to the system's "keyboards and languages" setting (I'm not sure this is the exact name as my Windows is in German) and made sure that:
- The desired input languages were available (they have to match your site's settings)
- and that they were associated with the keyboard layout I'm actually using
My settings currently look like this and the language spans only get inserted when I switch to another input language (on purpose), just like they should. :)
Stephan - Stephan, I think you're quite right in your observations. My PC is setup as a US localization with a Danish keyboard, and the annoying span tag always insists of inserting a <span lang="en-us"> tag.
But...
I simply refuse to change my keyboard or PC setup. Why? Because it simply cannot be correct that the code in the webpages I design depends on whatever keyboard I'm using. When I first discovered this I refused to believe it (thinking "no way, noone can design a program this stupid"), but unfortunately it seems to be the case.
Is the idea of someone coding a webpage in English from a, say, Spanish keyboard completely unfathomable to Microsoft?
Or from keyboard in different places with various layouts?
And if I'm coding pages in multiple languages on a website (which I am), should I repeatedly change my keyboard setup? Come on Microsoft, give me a break!
Well, since I'm not bothered by it in Code View I'll just shake my head and move on (but as I said before, had I been using Design View I would be furious!)
/MrMox- Edited byMrMox Wednesday, July 02, 2008 1:55 PMadded
- MrMox, I'm sorry I can't post exact instructions and screen shots for English Windows systems right now, but I think you should have another look at your system's setting, because what you wrote here should be no problem (and it's really not so difficult):
Is the idea of someone coding a webpage in English from a, say, Spanish keyboard completely unfathomable to Microsoft?
You just have to let your operating system know which input languages (and which keyboard layout) you're using. I'm currently using a German-Swiss keyboard and working on a German (not German-Swiss) Website and an English-US-Website. All I had to do was to specify these two languages as input languages in the control panel of Windows Vista (in both cases also specifying that I'm using a German-Swiss keyboard). Then you get this little icon in the lower right corner of your screen (language bar) which enables you to quickly change the input language. So when I'm working on the German website, I make sure German is selected and no spans are added, same is true for the English website. If I select a language that doesn't match the "Content-Language" meta tag, Expression Web adds the spans. This is actually quite useful, I just had not found any description of this behavior anywhere, so it took me a while to figure it out.
- Stephan,
Thanks for the instructions, but I don't think you get my point:
If my pages contains the correct language meta tags, why should I be forced to change keyboard just to avoid the <span> tags? Why can't it let me edit local and english pages from the same keyboard (after all we do have quite a lot of characters in common...)?
All this misery could have been avoided (and I wouldn't have given it a second thought) if - IF - it was possible to disable this 'feature'. But that's the core of the problem - nobody seems to know how to do it. The internet is full of suggestions ("maybe you could check/uncheck this checkbox" - "maybe you should check or uncheck that checkbox"), but nobody seems to know how to disable it. And the suggestions only work for some.
My suspicion is that it's some unfinished feature (the lack of disable/enable setting) that slipped through the final testing...
/MrMox - "why should I be forced to change keyboard just to avoid the <span> tags? Why can't it let me edit local and english pages from the same keyboard (after all we do have quite a lot of characters in common...)? "
I think you have misread Stephan L's posts. There is no changing of keyboards involved. There is letting the system know that, while using a language "A" keyboard, you will also be working in language "B", and "C", and... - Kathy,
Of course I know I don't have to change the keyboard physically...
According to Stephan's post he still have to select the correct input language every time he wants to edit a page in another language.
And my question is still: Why do I have to do this to avoid the <span> tag? Why can't I disable this 'feature'?
/MrMox - Just tried it again to confirm it...
I have a page with the <meta http-equiv="Content-Language" content="da" /> tag. Editing some text in Design View from a Danish keyboard still produces a <span lang="en-us"> tag...!
Whee... what a 'feature'...
/MrMox - MrMox is right, of course, there should be a simple option to prevent xWeb from adding the spans, just like there should've been an option to keep xWeb1 from adding the BOM in UTF-8 files.
Anyhow, I've reviewed the settings on 3 PCs with xWeb which we've got running here and wrote a lengthy post about this issue/feature on my blog (with screenshots in English). I hope this helps.
- Nice blog Stephan,
I guess I just have one of those 'weird' system where it doesn't work at all.
As you can se from my test above I have the <meta http-equiv="Content-Language" content="da" /> tag on the page and use a Danish keyboard (no other input languages defined), and still it insists on inserting a <span lang="en-us"> tag in my content.
Totally weird (and totally unusable)...
/MrMox - You know that you can specify more than one language in a language meta tag?
<meta http-equiv="Content-Language" content="da, en" />
See: http://www.w3.org/International/questions/qa-http-and-lang
(NOTE: I have no clue what Expression Web will do with this sort of declaration and don't have time to test right now using more than one language on a page so if you try it I'd be interested in your results.)
MS MVP Expression - Great link!
I never knew there was a difference between "language content" and "language audience".
Adding more languages to the meta tag didn't make any difference. Adding 'lang' and 'xml:lang' to the html tag didn't make any difference. Tried both with "Ignore the keyboard when deciding the encoding of new pages" checked and unchecked.
The only thing that can make the <span> tag disappear, is adding another 'Input language' which makes it necessary to select the input every time I edit a page in another language. So not a real solution.
Ah well, I'll just try to live with it and keep editing in Code View...
/MrMox - BUT...
Adding the appropriate 'Input languages', checking the "Automatically switch keyboard to match language of surrounding text." (Tools->Page Editor Options->General) and adding the appropriate lang and xml:lang to the html tag makes it all automatic.
Voila!
No manual selecting of Input Language and no more annoying <span> tags!
Thanks to everybody for the hints and the advices :-)
Now I'll just wait and see what problems the extra input language will cause for other programs...
/MrMox - Great, wanna write up your experience so others can benefit?
MS MVP Expression Will be happy to, but I don't know if my solution only works for some, like so many other suggestions on the internet.
This works for me:
I'm editing pages in English and Danish on a Danish keyboard.
- Add the relevant 'Input Languages' to Windows (you don't have to change the Keyboard layout setting)
- In my case I have "English (United States) - Keyboard: Danish" and "Danish (Denmark) - Keyboard: Danish".
- Check the "Automatically switch keyboard to match language of surrounding text" checkbox in Site > Page Editor Options > General.
- If you don't check this, you'll have to manually select the Input Language when you want to switch.
- Add "lang" and "xml:lang" attributes to the <html> tag on your pages
- Apparently EW reads this tag to determine which Input Language to use
- Just adding a language meta tag on the pages is not enough - EW doesn't seem to use it.
When I edit a page in English (with the attributes set to 'en' in the html tag), the Input Language (in the taskbar) automatically switches to 'EN' and no <span lang> tags are inserted in the text. Similarly, when I edit a page in Danish, the Input Language switches to 'DA' and no <span lang> tags are inserted.
Hope this can help others in the same situation.
/MrMoxHi!
I suspect that this problem is even bigger than before mentioned. I experience the same problem as MrMox, but my situation is somewhat different. My sites are in ONE language each and from the start they have both the xml lang tag and the meta content tab: <meta http-equiv="Content-Language" content="xx" set correctly. As well as all the above mentioned site settings and page editor setting. .. maybe excluding the "automatically-button", which I cant remember. It would have been on the default setting from the start, as I didnt know my way around ME then.
My keyboard language is SV, as well as the operating system. Still, this problem prevails on my Swedish site. The span lang= sv shows up as soon as I write in the design window, despite the spelling corrector working beautifully in Swedish. The span lang has been showing up for five months now - but now only remains on some pages. (why, I have no clue, the pages are all the same and controlled by dtws, so how it can be fine on some and not on others beats me)
A bunch of pages was originally imported from the Norwegian site. So they came into the site with all Norwegian tags. These has been changed since, but from the outset these where the pages with the problem, while the new pages created inside the Swedish site worked fine from the start. Therefore the conclusion would be that the original settings for xml+meta lang-tags remains in ME's thinking somehow.
But since, I have discovered originally-No-pages that work fine, and one in-site-created page that still gets span lang. This with the box Automatically switch keyboard to match language of surrounding text turned OFF. When checking the box, all I achieve is that BOTH pages play up and show span lang. I have now unclicked the button again.
Page examples:
page that doesnt get span lang: http://www.vitaelab.se/Fragor_och_svar_om_prenumeration_hos_Vitaelab.htm
page that gets the span lang when writing: http://www.vitaelab.se/Fakta/Omega_3.htm
This page has all Sv settings, incl keyboard and "automatically"-button checked and still get span lang:
http://www.vitaelab.se/Vitaepro.htm This page was originally a No-page.
As this site has been around for five months, lets instead use a new web site as our example, as I remember it step by step. Our Finnish website was created a month ago. It was copied from the Swedish one (published to remote site) after advices from the gurus here in the forum. Meta data was switched on from start, before import. Page editor language was not chosen from start, as I didnt remember where to find it. Server language in site settings was from the start set to English, as the only choices were English and Swedish. The whole site was imported with Swedish xml lang + meta lang content. The first change I did in the site was to change them into Finnish. With the keyboard being Swedish (as I didnt know the link to the keyboard and I have now discovered the "automatically"-box was checked from start) I got the span lang sv everywhere when editing in the design field. A few days after the import I set the site language in the Tools->page editor to Finnish. The problem prevailed, but now the spell checker worked for Finnish. The only way to get around the problem, was to switch all the xml and meta lang tags back to Swedish, then I could add content in the design field without getting span lang tags. While site language in page editor still set to Finnish.
I'm trying to do tests as I write, and I must say I get more confused by the minute.
I thought the Tools-page editor-site language was set ONCE for all pages??? Please confirm. I have tested two Finnish pages now. Both have all xml and meta set to FI. One page http://www.vitaelab.fi/Toimitusehdot_VitaeLab.htm had site language set to Swedish. That page then got span lang tags when writing, with sv-keyboard. With the page open I then changed the site lang to Finnish. Then I got rid of span lang. Then I decided to save the page (not closing it). Ten minutes after I edited the page -> span lang was back.
The other page http://www.vitaelab.fi/Tilaussivu.htm had site language set to Finnish, as well as xml+meta. It gets span lang sv too. I've tried to uncheck the "automatically" box for both pages, but both still get span lang tags. Keyboard was all the time set to Sv.
As this site is imported there are still other pages in the site with Sv-settings - will that effect the behaviour of these two pages??
The only way to get rid of span langs are to swich to keyboard lang FI (I dont want to do that) or to erase the xml+meta tags (dont want to do that either).
I totally agree with MrMox - I'd prefer to be able to turn the auto spanlang off. Especially as I and my editors work in the design window. Having it connected to the keyboard lang is a hassle when working parallell with four sites in four different languages, parallell with working with other company documents in word/excel etc, and emails on other topics. In those documents I write in three different languages without having to change keyboards. I can't change keyboard lang hundreds of times a day due to ME - thats crazy. And what when we get to creating websites for countries with totally different keyboard setups - as a European am I really supposed to have to work with a Chinese keyboard to be able to create a Chinese website???
I mean there must be tons of web editors (people) getting problems with this - at least in Europe. Lots of companies sell their products within Europe, that is EU, and benefit from having sites in different languages. Not all people setting the sites up speak all the languages they set up sites for, before handing it over to the text editing person. (we send the texts for translation, then do the set up process, then release it for day to day use to a local person). EU also has language rules - a company is supposed to offer their texts in several EU languages.
In three weeks I'm creating the German web site. The idea is to copy the Swedish web again - it helps with adding the German texts as Swedish is my native lang, and the Swedish site has the most SEO-friendly code. I would very much like a step by step guide from you gurus re the language settings. Should page editor lang be set to German before I import the pages? Should I use a go-between site for changing the xml and meta lang tags to German and then import the pages into the real new website? Or should I just create new pages in the new website and then copy in the code only below the meta?
It would be very interesting to hear ME-people reason around the span-lang - set up and the opportunities to turn it off for all of us working with one-language-sites, in languages other than our own = keyboard setup. I understand the feature for multi-lang-sites, but I would like to avoid it for one-lang-sites.
Best Regards
Anette Bargel- First of all let me point out that this issue has been driving me sooooo mad, I almost dropped all MS web editing programmes altogether (the same problem occors with Visual Web Developer).
And still, it is not solved - at least not for me...
Unfortunately MrMox solutions assumes that switching keyboard language (either automatically or manually) doesn't impact work flow. I am working on a German XP notebook a lot of the time, editing German, English and French websites. Needless to say that key-character positioning varies quite a bit between those languages/keyboards, and mixing my Ys with my Zs, or Ös with +s is not desired.
I understand that EWD is looking at the <html lang="... which sadly doesn't allow multiple language declarations, compared to the meta http-equiv="Content-Language". And to be honest, I cannot believe MS find it so difficult to introduce a simple switch-this-darn-span-thing-off option anywhere. Especially with all those comments and hair raising problems regarding this issueposted all over the InterWeb. Guess the attitude of "we adjust your code automatically, as we are sure we know what you are trying to do" was inherited from infamous FrontPage.
I personally don't mind helping people a little creating valid code. But there should always be a straight forward way of disabling those features without going through Web Developer's Hell and the Google Help Search of Doom.
nadworks cb - But did you notice the first part of (my) solution?
- Add the relevant 'Input Languages' to Windows (you don't have to change the Keyboard layout setting)
- In my case I have "English (United States) - Keyboard: Danish" and "Danish (Denmark) - Keyboard: Danish".
If changing input to English would turn my keyboard layout English as well, it would drive me crazy, but you can define different input languages and keep the keyboard layout as shown above.
/MrMox

