Technical support This forum is closed.
Version 1.x > Technical support > Multilingual problem View modes: 
User avatar
Member
Member
zlobish - 3/7/2005 10:42:25 AM
   
Multilingual problem
I have two languages and everything is working fine except presentation of documents. Every link i get has country code in it, and i am getting 404 error.

Thanks in advance,
Vedran

User avatar
Guest
admin - 3/8/2005 10:51:26 AM
   
Re: Multilingual problem
Hi Vedran,

Thank you for your message. Navigation controls (such as CMSMenu, CMSTreeMenu, etc.) render correct path automatically.

However, if you render the path in your code (e.g. in CMSRepeater) you need to use Functions.RemoveCultureFromPath(string path) method to remove the culture code from the path in custom generated links.

Example:

<a href='<%=ResolveUrl("~/.")%><%# WebProjectCS.Functions.RemoveCultureFromPath(DataBinder.Eval(Container.DataItem, "AliasPath")) %>'>Read more</a>

Should you need any help with that, please feel free to ask us.

Best Regards,

User avatar
Member
Member
zlobish - 3/8/2005 3:37:31 PM
   
Re: Multilingual problem
Thanks for quick response.
I changed functions.cs
to
public static string RemoveCultureFromPath(object staza)
{

string result = "";
string path=(string)staza;

if ((ConfigurationSettings.AppSettings["CMSUseMultilingualSupport"] + "").ToLower().Trim() == "true")
{
result = path.Substring(path.Split('/')[1].Length + 1);
}
else
{
result = path;
}




return result;

}

and it's working fine

User avatar
Member
Member
zlobish - 3/8/2005 3:44:40 PM
   
Re: Multilingual problem
I have another question.

What about diferent encoding? For example i need site in two languages, english and serbian, and for serbian i need two encodings sr-SP-Latn, sr-SP-Cyrl. does Kentico support automatic conversion from latin to cyrillic?

Thanks !
Vedran

User avatar
Guest
admin - 3/8/2005 3:59:43 PM
   
Re: Multilingual problem
Well, there's no native support for that in Kentico CMS, but perhaps you could achieve it using ASP.NET globalization features. You can specify the responseEncoding in web.config:

<globalization requestEncoding="utf-8" responseEncoding="utf-8" />

... and the same can be done in your code. Please try if changing of responseEncoding to "sr-SP-Latn" or "sr-SP-Cyrl" helps. If so, I will be able to tell you how to do that in the code so that users can switch between those encodings.

Thank you.

User avatar
Guest
admin - 3/8/2005 3:53:08 PM
   
Re: Multilingual problem
Thank you for improving the code I posted here :) I'm sorry I forgot to make the conversion to string.

Thanks!