Using Sitecore 8.2.current we're seeing
la=en added to a number of our media library (unversioned) image usages (
<img src="_.jpg?la=en" />).
In Sitecore version 7.something (7.2?) the recommendation was to override
GetMediaUrl to work around Sitecore not having configuration options to cover this.
Is that still the best practice in Sitecore 8.x, or can we make a configuration change to workaround this?
In the master database we only have en in /sitecore/system/Languages.
Verifying with /sitecore/admin/showconfig.aspx, on
linkManager we have
<add name="sitecore" languageLocation="filePath" languageEmbedding="never" /> (only relevant attributes shown).
In case it mattered, I also added
language="en" to the relevant
<site> declaration, to no avail.
Thanks to some assistance in the comments, if we use
Sitecore.Resources.Media.MediaManager.GetMediaUrl(imageField.MediaItem, mediaUrlOptions); and set
new Sitecore.Resources.Media.MediaUrlOptions() or
la=en is not added
If we use
Sitecore.Links.LinkManager.ExpandDynamicLinks() with a Rich Text field type image sources are expanded, but include the language parameter.