As is mentioned in the documentation , TitlePropertyAlias is the alias of a property that should be entered in each of your main document types (or in a parent document type from which they all inherrit) and in your translation document types. This will serve as the title or "name" of each page, so that it can be translated in all menus.
For example if you have a document type named "FreeFormPage" you could add a textstring property to it and give it the alias "title". You should also add a property with the same alias and type to FreeFormPage_Translation.
You can then create a page of type FreeFormPage and for example place the name "Home Page" in the "title" field in English in the main page and "Page d'Accueil" in the French translation. When adding the navigation macro to the page's template, you would set TitlePropertyAlias="title". This way, when the visitors to your site choose to see content in English, they will see a link labelled "Home Page" in the navigation and when they choose French they will see a link labelled "Page d'Accueil".
Thanks for the feedback. I could manage to set links but I have two questions more.
As you mentioned like in the following, the first language declared assumed to be the default one but this is not the case for me.
"The first language on the list is not checked on the translation creation form. This is because the first language declared in the Settings section is assumed to be the default one."
So if you declared english and greek in the settings, the web site first should display greek as default language. How could I achieve it?
Secondly, some of my pages uses usercontrol files. Even though I placed PropertyTranslation macro into the template which needs to be translated, the user control file is not displayed.
If your default language is not the first one on the list, you can specify it with a key in your app settings. For example for having French as a default language you would add this:
<add key="uPolyglotDefaultLanguage" value="fr" />
Apologies for not having mentioned this in the documentation.
About your second question I am afraid I did not understand exactly what you tried to do. Would you mind pasting the part of your template which you are referring to here so that I can be sure?
How about IRC? I have connected to eu.undernet.org and have started a room called polyglot . I'll be around for a while if you would like to discuss this.
I think I have understood now. Have you created a user control and associated it with a macro which you have inserted into the bodyText field using the rich text editor?
Oops :( ... I am really sorry to disappoint you but this is one scenario which I have not managed to get working. As far as I have been able to find out, at least in the current version of Umbraco, you cannot call a macro within a macro. So, since PropertyTranslation is an umbraco:macro tag, as opposed to umbraco:Item, macros, like for example the ones associated with your user controls, will not show up when inserted in the rich text editor...
In my case, this has not been an issue since I place user control macros directly into the templates and use umbraco dictionary items within the user controls to provide multilingual labels (if you do this please see "Setting the Culture" in the documentation), but I don't know if this is something you would consider doing.
Great! I'm glad you have found a solution. I always have this issue in mind in any case. If in a subsequent version of Umbraco macros can be added inside macros or if I come up with some other way to support such a thing I will add the feature to a later version of the package.
TitlePropertyAlias?
What should I set as TitlePropertyAlias, because at the moment navigation displays nothing? Could you provide an example?
Hello!
As is mentioned in the documentation , TitlePropertyAlias is the alias of a property that should be entered in each of your main document types (or in a parent document type from which they all inherrit) and in your translation document types. This will serve as the title or "name" of each page, so that it can be translated in all menus.
For example if you have a document type named "FreeFormPage" you could add a textstring property to it and give it the alias "title". You should also add a property with the same alias and type to FreeFormPage_Translation.
You can then create a page of type FreeFormPage and for example place the name "Home Page" in the "title" field in English in the main page and "Page d'Accueil" in the French translation. When adding the navigation macro to the page's template, you would set TitlePropertyAlias="title". This way, when the visitors to your site choose to see content in English, they will see a link labelled "Home Page" in the navigation and when they choose French they will see a link labelled "Page d'Accueil".
I hope that this helps!
Hi Dimitri!
Thanks for the feedback. I could manage to set links but I have two questions more.
As you mentioned like in the following, the first language declared assumed to be the default one but this is not the case for me.
"The first language on the list is not checked on the translation creation form. This is because the first language declared in the Settings section is assumed to be the default one."So if you declared english and greek in the settings, the web site first should display greek as default language. How could I achieve it?
Secondly, some of my pages uses usercontrol files. Even though I placed PropertyTranslation macro into the template which needs to be translated, the user control file is not displayed.
Hello ds!
If your default language is not the first one on the list, you can specify it with a key in your app settings. For example for having French as a default language you would add this:
<add key="uPolyglotDefaultLanguage" value="fr" />
Apologies for not having mentioned this in the documentation.
About your second question I am afraid I did not understand exactly what you tried to do. Would you mind pasting the part of your template which you are referring to here so that I can be sure?
Cheers
Dimitri
Would you mind contacting you via skype if it is OK for you cause it would be easier to tell my problem, I think
In both cases, you could find the portion of the code for my second question about usercontrol, dimitri.
How about IRC? I have connected to eu.undernet.org and have started a room called polyglot . I'll be around for a while if you would like to discuss this.
I am not good at IRC, dimitri but I would be grateful to help me fix that issue by checking code snippet above
I think I have understood now. Have you created a user control and associated it with a macro which you have inserted into the bodyText field using the rich text editor?
That is right, dimitri :)
Oops :( ... I am really sorry to disappoint you but this is one scenario which I have not managed to get working. As far as I have been able to find out, at least in the current version of Umbraco, you cannot call a macro within a macro. So, since PropertyTranslation is an umbraco:macro tag, as opposed to umbraco:Item, macros, like for example the ones associated with your user controls, will not show up when inserted in the rich text editor...
In my case, this has not been an issue since I place user control macros directly into the templates and use umbraco dictionary items within the user controls to provide multilingual labels (if you do this please see "Setting the Culture" in the documentation), but I don't know if this is something you would consider doing.
OK then I copied textpage template and renamed it as textpageSub, use textpageSub only for that page which has macro associated with usercontrol.
Great! I'm glad you have found a solution. I always have this issue in mind in any case. If in a subsequent version of Umbraco macros can be added inside macros or if I come up with some other way to support such a thing I will add the feature to a later version of the package.
is working on a reply...