Links to "microsoft.com" pages with "hard-coded" Language tags in the URL

1

Please login or register to vote for this query.

(click on this box to dismiss)

If language tags were automatically stripped from microsoft.com url's in posts/comments, then the user would automatically get the pages in their native language (according to browser settings, obviously) rather than being forced to a version that might not be legible for them. ...hmm, I wonder how many links are we talking about here? (Surely it's a crapload!) The same could be done with links from Wikipedia, and other popular sites with language tags in the URL.

Sitecore

Q&A for developers and end users of the Sitecore CMS and multichannel marketing software

select
  year(creationdate) yr,
  lower(SUBSTRING(body,PATINDEX('%microsoft.com/__-__/%',body COLLATE SQL_Latin1_General_CP1_CI_AS),LEN('microsoft.com/')+6)) Lang, 
  (len(body)-len(replace(body, 'microsoft.com/', '')))/len('microsoft.com/') occurences
into #temp
from posts
where
  closeddate is null
  and posttypeid in (1,2)
  and body like '%microsoft.com/__-__/%'
  and year(creationdate)>=year(getdate())-##yearsback:int?1##

-- TAB #1: aggregated by tag
select 
  min(yr) Oldest,
  max(yr) Newest,
  Lang,
  count(*) [# of Posts],
  sum(occurences) [# of Links]
from #temp
group by Lang
order by sum(occurences) desc, count(*) desc, Lang

-- TAB#2: totals
select sum(occurences) [Total Occurrences], count(*) [Posts Total]
from #temp

-- yearsback: How many years back (before this year)?


-- wikipedia "en" language tag example: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
-- mozilla "en-US" example: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/debugger
-- (both these sites detect the language only if tag is removed from url.)

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results