Hi Jeroen, i have downloaded the oct 4/2017 version of https://our.umbraco.org/projects/developer-tools/1-1-multilingual-example/. The project works well, but implementing it in my own project to get different urls per node in two languages: English and spanish i'am getting the following error in the GetOtherUrls method. specifically in this code:
for (int i = 0; i < domains.Count; i++)
{
// Get the domain and matching parent url.
var otherDomain = domains[i];
var otherParentUrl = parentUrls[i];
// Get the parent url and add the url segment of this culture.
var urlSegment = content.GetUrlSegment(otherDomain.LanguageIsoCode);
urls.Add(otherParentUrl.EnsureEndsWith("/") + urlSegment);
}
in the line : var otherParentUrl = parentUrls[i];
this is the exception:
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
at System.Collections.Generic.List1.get_Item(Int32 index)
at Umbraco.Extensions.UrlProviders.MultilingualUrlProvider.<>c__DisplayClass1_0.<GetOtherUrls>b__0() in C:\Projects\NET\PolancoPlastica\PolancoPlasticaWebPage\PolancoPlastica\Umbraco.Extensions\UrlProviders\MultilingualUrlProvider.cs:line 144
at Umbraco.Core.Cache.CacheProviderExtensions.<>c__DisplayClass5_01.
Error in GetOtherUrls method
Hi Jeroen, i have downloaded the oct 4/2017 version of https://our.umbraco.org/projects/developer-tools/1-1-multilingual-example/. The project works well, but implementing it in my own project to get different urls per node in two languages: English and spanish i'am getting the following error in the GetOtherUrls method. specifically in this code:
in the line :
var otherParentUrl = parentUrls[i];
this is the exception:
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource) at System.Collections.Generic.List
1.get_Item(Int32 index) at Umbraco.Extensions.UrlProviders.MultilingualUrlProvider.<>c__DisplayClass1_0.<GetOtherUrls>b__0() in C:\Projects\NET\PolancoPlastica\PolancoPlasticaWebPage\PolancoPlastica\Umbraco.Extensions\UrlProviders\MultilingualUrlProvider.cs:line 144 at Umbraco.Core.Cache.CacheProviderExtensions.<>c__DisplayClass5_0
1.any help would be very appreciated,
is working on a reply...