usage of dictionary for sitecore multilingual site - sitecore

Previously I had my website in English language. Now there are request to create website in 2 other languages German and French.
I created items in necessary languages. I want to translate labels like first name, last name etc that go through the whole application, so i used dictionary with "Key -> FirstName" and "Phrase First Name". Created dictionary items in English,French and German.
In code I made below changes
<h4><% Sitecore.Globalization.Translate.Text("FirstName");%></h4>
But I'm unable to see First Name render on the page. Is there any other settings I need to make. Please advice.

Based on your comments you may find the answer you are looking for in this question
sitecore: multi-lingual site
It does outline you may need to contact support if the solution doesn't work for you, but it may be resolved in a version later than Sitecore 6

Related

Sitecore displaying Japanese even though language is set to English

Some elements of Sitecore have randomly started using Japanese. I have checked for the following issues:
I have checked to make sure our Sitecore instance is set to English.
I looked through the entire solution for references to jp but it doesn't seem that it is being hardcoded into anywhere.
This has been affecting the following:
RTE's (the element selection menu e.g h1, h2, h3... is in Japanese)
Our validation rules:
Anyone had a similar issue.
This is on Sitecore 7.5.
UPDATE 1
I see that some items under core/sitecore/system/Dictionary have the Phrase field set to Japanese text. Could this have anything to do with it?
The user you're logging in with, what language preferences is set for it?
Is one thing that the Sitecore site runs in English, but a CMS editor user can still prefer to operate Sitecore in another language.
Control Panel => Region and Language settings
Figured it out. I'm assuming this was a bug in Sitecore but what happened is that all the Japanese translations in the core database's dictionary were moved to the English versions. This meant that it would translate to Japanese if it detected the mode was set to English.

How to create sub-pages for apphook model instances with django-cms?

Question Context
I am responsible to design the cms architecture for a project.
The requirements state that a group of editors should be able to create "Projects".
Each project..
saves meta data about itself
is queryable from other places (e.g. top 5 projects).
has a page that displays information about it. (does not need to be a cms page instance)
can be connected to countries (meaning that an implementation of that project exists in the selected counties).
can have sub-pages which in turn can also be nested.
Imagined Example
Using the django-cms documentation as a bases I would image the resulting structure to look like this:
Projects (apphook)
"Project 1" (Page for project 1 model instance)
"Project 2" (Page for project 2 model instance)
"Project 2 Subpage 1" (Subpage for project 2 model instance)
"Project 2 Subpage 2" (Subpage for project 2 model instance)
"Project 2 Sub-Subpage" (Subpage of "Project 2 Subpage 2")
However that does not seem to exist or at least I did not see any references on how to get such a structure.
In a video I heard that as soon as there is an apphook.. subpages do not make sense anymore.
Somewhere else I read that in theory if the hook is permissive enough.. it could be combined. However even if that works.. the subpages would not be liked to actual instances of the custom apphook model.
PS: I am currently using: django-cms==3.3.0
Question
How can I feature such a structure using django-cms?
I figured it could be done by having an apphooked page for each project. In that case.. the server would have to be restarted for every newly created project. That does not seem to be very elegant.
Alternatives
I have been working with wagtail on a previous project. Thus I do know how to implement such a structure with wagtail easily using ProjectPage and ProjectSubpage models.
I refuse to give up on django-cms being capable of replicating such functionality. I am open for alternative paradigms and approaches. Maybe there are some I have not thought of. If so please let me know. :)
Request
Guidance and ideas are very welcome!
Please tell me if you know of any way how to get that or have some idea that could point me in the right direction.
Thank you!
A couple of points here for you.
django CMS can happily serve pages "beneath" and apphook, but the apphook gets priority during URL resolution. So, just make sure that your apphook's URL patterns don't gobble up everything and sub-pages should be OK.
An alternative approach would be to make a one-to-many table that holds "page-like" attributes (title, meta-attributes, etc.) and at least one PlaceholderField. This can then be used to present what appears to be normal CMS pages that the apphook-itself can control with its views. So, you could have apphook-model-specific context and url-patterns and still have almost all of the front-end editing features of the CMS.
I hope this helps!

Can a multilingual Sitecore 6 web page have an alias for each language?

Can a multilingual Sitecore 6 content pagehave an alias for each language? It appears that I can only add one per content page.
For instance, labour_market_survey.html has an english page and a french page:
http://www.site.ca/en/labour_market_survey
http://www.site.ca/fr/labour_market_survey
But I can only give the content page one alias:
http://www.site.ca/survey
How can I add a french alias, such as:
http://www.site.ca/enquete ?
Aliases are just sort of web-root-level "links" to certain items, mostly intended to use for marketing campaigns as short and friendly Tokens. To achieve what you want you may consider few options:
If you have configured an individual website for each language - then you may create SiteAliasResolver processor for HttpBeginRequest pipeline. This will give you an option to have aliases on website level. Please reed this blogpost describing how to achieve that (with code samples).
Another option would be to use Redirect Module, as it will do exactly what you need. There was a question on Redirect Module recently, so there is exact example how to create a redirect item for any virtual URL that will do 301 to any specific sitecore item (which belong to some page item under corresponding language website):
If you are resolving languages on-a-fly so that the same item in Sitecore serves different languages (based on criteria how you resolve that), then you may use aliases as they are (but as I understood from your example that isn't your case)
P.S. Also, if you decide to go with aliases, mind Canonical URLs (link one and link two) as they may affect your SEO.

default languages for items and folders in sitecore

I'm working in a multi-site, multi-lingual sitecore project, and from time to time, someone adds lots of content on certain sub-site, fight hours with the publishing and being unable to see the updated content, and eventually realise after a couple of hours that all the input was in the wrong language for the sub-site.
So i'm wondering if there is a way in sitecore to support the following:
a folder (for a sub-site) that supports that after clicking an existing item below it, the language automatically changes to the default language for the site folder
since the language is automatically changed, new items created below that folder will be created in the default sub-site language, unless the user explicitly changes it to something else
If the above is impossible or not supported, an excellent workaround would be to be able to change the language of an item language version (say, i created an english version for a page on a spanish site with all the content in spanish, so i want to tell sitecore that i want to make this version actually the spanish version, without going into copying fields manually in the translate ui
It sounds like you might want to consider a few things:
The Language Fallback Provider - this allows you to have have content fallback from one language to another if it doesn't exist.
A custom extension (maybe an event handler for item:creating or item:created) to Sitecore to switch the context language based on where an editor is creating an item.
Just ideas right now...
An alternative approach would be to work with language read and language write security settings for your content contributors.
If your contributor for your Spanish site should only be adding items in Spanish then configure their access settings so that they aren't allowed to create content in other languages.
If you have a lot of content that has been entered in the wrong language then you can use the Globalization - Export language tool (from the Start menu) to export it to an XML file, manually replace the language tags (this is as simple as a search and replace on "en>" -> "es-ES>" for example) and then reimport it in the new language using the Globalization - Import language tool. Warning though: this WILL overwrite any existing versions.

How can I change the current language that users see for a Sitecore site?

Let's say I have a web site that is translated in to two languages - English and Spanish. I want to give the users a toggle switch at the top of the page that allows them to switch back and forth between the two languages. How would I do that? I don't want to set up different websites. I only want one website. I just want the user to be able to click on a button or link or something and go from English to Spanish. Now as they move around the site they are viewing the entire site in Spanish. Then if they click on the button or link again they would go back to English. Is there something I have to do in the code behind to tell Sitecore to "use" a different language?
You can switch the context language using "sc_lang" query string parameter. For example:
http://youwebsite.com?sc_lang=en
Typically in Sitecore you will want to represent the language using the built-in URL prefixes, e.g. http://www.example.com/en or http://www.example.com/es. We often use a cookie that we read in the httpRequestBegin pipeline to enhance the Sitecore LanguageResolver. Your language "toggle" could appropriately set that cookie.
See this article by John West for more detail and sample code.
https://community.sitecore.net/technical_blogs/b/sitecorejohn_blog/posts/repost-overriding-sitecore-39-s-logic-to-determine-the-context-language
You can write your own LanguageResolver Pipeline to do this.
Or you can extend your URL by Using the sc_lang querystring Parameter eg.: sc_lang=en-EN or sc_lang=de-DE. If you have configured your linkmanager fine this should work.