How to get multiple language sites set up in Sitecore? - sitecore

I am just starting to add support for multiple languages on my site... having a spot of trouble. Here are the steps I've taken so far:
In Control Panel -> Globalization, added a new language (German)
Added a new <site> definition in Web.config with hostName="localGerman.com" and language="de". Also added an alias in my hosts file for localgerman.com to point to localhost and added the host header in IIS.
Went to an item in my tree and added a new version for German. Published whole site.
Now, the host/site setup seems to work OK. When to go to http://localgerman.com/ I get my home page, with lots of missing data... there is no German version... so seems to be using the correct language.
However... when I go to the item I've added a German version of, I still get blank data. In the debugger, I can see that Sitecore.Context.Item is the German version... but all the fields are blank. Item["Content"] returns an empty string. If I manually set the language to "en" on the URL (http://localgerman.com/myitem.aspx?sc_lang=en), then I get the English version with data.
What am I missing here?
Also... when loading the German home page... my menu is blank. Presumably because the items which generate this content do not have German versions. I was under the assumption that when a language-specific version for a given item could not be loaded, then the default language version is used? But this does not seem to be the case. Am I wrong?

OK, looks like I just had the language code wrong. Setting the site language to "de-DE" instead of just "de" worked.
This is a little confusing because the default sites use language="en" instead of en-US.

You added a German version of an item, but did you fill in the fields in German ? Any localizable fields (non-shared) will be empty by default when a new version is created. It sounds like you did the other parts correctly.
The menu being blank is expected: When you try to get an language version of an item that doesn't exist, Sitecore will return null.

Related

Create new language in mid-project

Was requested by the client a new language to add to the project in sitecore. I'm having some issues with that,
I've created the language, however all the renderings are empty for the new language.
There's no version assigned to any item for the new language also.
I tried to do a trick that was to export the English language and open the generated xml file and rename the tags , to the requested language and then import. But when I'm trying to import it, shows as I was importing English language and not the new one.
How can I create a new language with all the renderings and content (even if it goes to english when empty string, I know it's default procedure) ?
Thanks
You can use Powershell script for that.
See e.g. this blog http://www.coreblimeysitecore.com/blog/create-language-versions-using-sitecore-powershell/
Sample code is
Add-ItemLanguage -Path "master:\sitecore\content" -Language "en" -TargetLanguage "de-AT","de-de","en-za","fi-fi","fr-be","it-it","pl-pl","ru-ru","sv-se","fr-fr" -IfExist OverwriteLatest -IgnoredFields ""
And here is a very similar question on http://sitecore.stackexchange.com site:
https://sitecore.stackexchange.com/questions/1584/create-new-language-version-for-content-branch

How to add a new language in Sitecore 8?

I'm working on Sitecore 8 and want to add a new language but Im having a message:
The spell checker dictionary does not exist.
Could you please help me?
All the dictionary files are stored in sitecore\shell\Controls\Rich Text Editor\Dictionaries\ directory.
There is no en-AU dictionary there by default (there are en-UK and en-US dictionaries). You can use one of them I guess. Or you can try google en-AU and use something from the Internet "en-AU.tdf" google search.
I had the same issue. I was able to resolve it by editing the "InvalidItemNameChars" setting temporarily.
Our project had a patch for InvalidItemNameChars like this:
This setting is usually in web.config. If you don't find it there, check "/sitecore/admin/showconfig.aspx" for InvalidItemNameChars.
I had to remove the '-' from the value and create the language. You will not get the error on not selecting the spell checker. You can leave it empty.
Once you are done creating the language add the '-' back to the config (in my case it was a patch config).

Sitecore 7.2 Media Library images not working with underscore in the name

I just upgraded a client's test installation of Sitecore to 7.2 (SP1) and now, any image that has an underscore in its name is throwing a 404 error when being referenced by a page. This was actually a series of upgrades from 6.4 so it's quite possible that a config setting somewhere got missed along the way, but I don't see anything standing out at me that would cause this problem.
If I change the image name to not have an underscore, it works fine, and it also works fine if I set "Media.UseItemPaths" to false, but they would prefer it if their image URL's had the file name displayed.
Can anyone help identify what may have gone wrong?
Due to a change in Sitecore 7.1, any replacements specified in encodeNameReplacements are now also applied to media items as well as regular items in the content tree.
One option is to remove the replaceWith="_" declaration, but the likely reason this was added was to possibly replace spaces in your URLs so they do not display with %20. Removing this declaration will mean they return!
You can instead apply the fix specified in this Sitecore Knowledgebase article: Sitecore is unable to open media items when using encodeNameReplacements

Sitecore multilingual site, default to non-english language even when English version exists

I am working on a sitecore 7.1 site which in Web.config is set to a Swedish language.
<site name="SiteName" language="sv-SE" ... />
It works as expected if I go to a page which only has a Swedish version, but if an English and Swedish version of an Item exists, it prefers the English version. How can I change it so it prefers the Swedish version by default even if an English version exists.
I've read John West's post on how Sitecore language can be set here and of the five ways he mentions language can be set, I think the following 2 may be y pertinent to me, but I'm not sure:
Language cookie associated with context site: in my request, I see there is a cookie se#lang=sv-SE. First is this the site context language cookie? If yes, then language is getting set elsewhere down the pipeline.
The default language associated with the context logical site. I'm not sure how to get at this.
The site language setting should be enough, but just in case, there are some other settings you could check:
ClientLanguage: By default, this is set to 'en'.
DefaultLanguage: By default, this is set to 'en'.
The ClientLanguage should not be used for users visiting your site. From my understanding, that is used for the editing interfaces.
Also, according to my decompiler, the Sitecore 7.2 pipelines should only use the DefaultLanguage if the site language cannot be found.
I did notice that a user's cookie for language is read before it will default to the site language. Are you sure you have a fresh session when you are visiting the page with two languages and the user's default session language has not already been set?
Otherwise, as mentioned in one of the comments, do you have a fallback module installed that may have their own configurations?
I think this is more of a feature than a bug. I narrowed down the causes on my end and it appears to be caused by the following.
My browser sends a request header that it expects english content.
if a version of the content exists in the requested language, sitecore prioritizes english, per the user's preferred language, even if the site is configured to default to a different language.

Umbraco error in Document Types

A long time ago I first setup a website in Umbraco. This seemed to be working fine.
I have now come back to it about a year later, and was initially getting the following error when selecting a Document Type (any document type in the Settings tab):
A bit weird, because earlier I didn't have this issue, but fine. I do what it says, and add <identity impersonate="true"/> to the <system.web> node in web.config.
While it does fix the initial issue, I now have the following on all document types:
When trying to create a new Document Type, I get the same kind of error, but then the ReturnUrl part is ReturnUrl=/umbraco/create.aspx?nodeId=init&nodeType=inittemplates&nodeName=Templates&rnd=20.2&rndo=21.2&nodeId=init&nodeType=inittemplates&nodeName=Templates&rnd=20.2&rndo=21.2' - but only if I tick the box 'Create template for this item'. The same happens when I try and create a Template.
After Googleing I came up with this: our.umbraco post with similar issue. One (unconfirmed) solution is that there's an illegal name in a document type/ template - but I haven't changed anything, and might be fixed by going into the database.
I did check the /masterpages folder, the only 'strange' characters in there are - and _.
In my Document Types I have on named 'Textpage (Two col)' and another named 'News & Events list'. I'm a bit hesitant to just delete them, since I don't have enough Umbraco knoledge to be sure this will fix my issue...
Is there any known solution for this, or will I also have to go into the database (and if so, whereabouts?)
I'm running Umbraco 4.7.2, assembly version 1.0.4500.21031.
I've hosted this site with GoDaddy.com - I don't know if that would be relevant.
[Update 1]
As per Tom Maton's comment:
The requirepermissions should be set to false, and have been.
in Appsettings I've set this:
<add key="umbracoUseMediumTrust" value="true" />
And I've added Trusted_Connection=yes to the connectionstring.
the problem remains.
[Update 2]
Tried the solution amelvin provided, but no dice. Doctypes and templates still give the error. I'm getting more certain it's some security issues. Which folder would correspond to the Templates? Would that be the masterpages folder? If so, what kind of permissions does that one need?
It could be that you don't have full trust on your Go Daddy environment?
Check this post out http://our.umbraco.org/forum/getting-started/installing-umbraco/17856-Umbraco-on-GoDaddy-Shared-Hosting
Could help resolve your issue.
The error could be a knock on from permissions errors as yet unsolved.
But the error is thrown if the content page does not have a template assigned or if Umbraco thinks it doesn't have a template. If absolutely nothing has changed to the site then it could be that the umbraco.config file has somehow got corrupted (it will contain all the doctype/template cross reference info). This can be fixed by right clicking on the top 'content' node and choose 'republish entire website'.
Secondly navigate to the settings | document types (if you can now) and check the templates dropdown on the first tab of the appropriate document type. If its set to 'please select' then this error will get thrown when any page tries to render without a valid template assigned. If a default template is assigned - then go to that template and re-publish it - Umbraco may have lost it.
If this does not work then check if the template is assigned properly. Go to the same place in the content tree as the problem page and try to add a node with the desired doctype. If no choices are offered then it could be that the parent tab no longer allows the correct doctypes as children nodes, so go back to the doctypes and check the allowed children (second tab) of the parent node.
If none of this works without odd errors being thrown then its a mystery!
Here are a list of Permissions required for Umbraco http://our.umbraco.org/wiki/reference/files-and-folders/permissions
Or you could use one of the steps below to check all the folder permissions.
http://our.umbraco.org/wiki/reference/files-and-folders/permissions/perform-permissions-check
Or install this package. http://our.umbraco.org/projects/backoffice-extensions/ugolive this will allow you to check the permissions are correctly setup.