I also went going forward with my updating, hoping to find the issue or fixing it with a new update (replaced Umbraco and Umbraco_Client folders totally), in this case to 7.5.3, but with no success.
Any ideas why LocalizedText is returning empty? I have another site on the same version that i updated via nuget and dont have this issue.
Nobody has any idea why this happens? Guess it isn't a recurring problem. I might try and debug through the source code to check what is being done here:
/// <summary>
/// Get the json localized text for a given culture or the culture for the current user
/// </summary>
/// <param name="culture"></param>
/// <returns></returns>
[HttpGet]
public JsonNetResult LocalizedText(string culture = null)
{
var cultureInfo = string.IsNullOrWhiteSpace(culture)
//if the user is logged in, get their culture, otherwise default to 'en'
? Security.IsAuthenticated()
//current culture is set at the very beginning of each request
? Thread.CurrentThread.CurrentCulture
: CultureInfo.GetCultureInfo("en")
: CultureInfo.GetCultureInfo(culture);
var textForCulture = Services.TextService.GetAllStoredValues(cultureInfo)
//the dictionary returned is fine but the delimiter between an 'area' and a 'value' is a '/' but the javascript
// in the back office requres the delimiter to be a '_' so we'll just replace it
.ToDictionary(key => key.Key.Replace("/", "_"), val => val.Value);
return new JsonNetResult { Data = textForCulture, Formatting = Formatting.Indented };
}
OK, so i come back with some news. Since nobody was able to have a quick response or notion of what the problem could be, in the tip of their fingertips, i debuged the source code for my version looking for an issue.
When loading the Settings Tree and when entering in the above function, it would have culture defined to "pt-PT" for each node that doesn't load the title properly. For the other ones that show correctly, it would have culture defined to en-US. When i forced the culture to go from "pt-PT" to "en-US", it would load the full Tree properly.
I went to my Global.cs file, under App_Code i found:
public class Global : Umbraco.Web.UmbracoApplication
{
protected void Application_AcquireRequestState(object sender, EventArgs e)
{
#region override Culture
CultureInfo culture = new CultureInfo("pt-PT");
culture.DateTimeFormat.DateSeparator = "/";
culture.DateTimeFormat.ShortDatePattern = "dd/MM/yyyy";
Thread.CurrentThread.CurrentCulture = culture;
Thread.CurrentThread.CurrentUICulture = culture;
#endregion
}
}
So somebody forced, the culture for the UI, even though in the web.config we have the umbracoDefaultUILanguage set to "en". We've been using this since the initial 7.2.4 version without any issue or interferance.
When commenting:
Thread.CurrentThread.CurrentUICulture = culture;
The Backoffice filled all the titles correctly.
Either way, for me, it doesn't explain this... incosistent language behavior. Why do some tree nodes have pass different cultures to get a localized title value? I could understand if all titles were not being returned correctly because of "pt-PT" being passed but...
LocalizedText service for Backoffice labels is returning empty
Hello everyone!
I made a manual upgrade from 7.2.8 to 7.3.8 and i encountered an issue with the backoffice. Here is a picture:
I have cleared the TEMP folder and bumped the ClientDependency.config. I have checked my web.config and i have the current key:
When looking for the network calls, i see this url being called with success but returning a empty json:
I have checked and i have the en_us.xml and en.xml in the current place:
I also went going forward with my updating, hoping to find the issue or fixing it with a new update (replaced Umbraco and Umbraco_Client folders totally), in this case to 7.5.3, but with no success.
Any ideas why LocalizedText is returning empty? I have another site on the same version that i updated via nuget and dont have this issue.
Best Regards!
Hello there!
Nobody has any idea why this happens? Guess it isn't a recurring problem. I might try and debug through the source code to check what is being done here:
Best Regards!
Hello again,
Forcing this code, i managed to supply most of the missing resources:
But some of the nodes in the trees dont load the text, even though the LocalizedText returns the values:
Heres the response of LocalizedText, respective to Document Types (i suppose):
Does this ring any bell to anyone? I'm feeling a bit overwhelmed with this.
Best Regards
OK, so i come back with some news. Since nobody was able to have a quick response or notion of what the problem could be, in the tip of their fingertips, i debuged the source code for my version looking for an issue.
So i arrived at this: https://github.com/umbraco/Umbraco-CMS/blob/dev-v7/src/Umbraco.Core/Services/LocalizedTextService.cs#L60
When loading the Settings Tree and when entering in the above function, it would have culture defined to "pt-PT" for each node that doesn't load the title properly. For the other ones that show correctly, it would have culture defined to en-US. When i forced the culture to go from "pt-PT" to "en-US", it would load the full Tree properly.
I went to my Global.cs file, under App_Code i found:
So somebody forced, the culture for the UI, even though in the web.config we have the umbracoDefaultUILanguage set to "en". We've been using this since the initial 7.2.4 version without any issue or interferance.
When commenting:
The Backoffice filled all the titles correctly.
Either way, for me, it doesn't explain this... incosistent language behavior. Why do some tree nodes have pass different cultures to get a localized title value? I could understand if all titles were not being returned correctly because of "pt-PT" being passed but...
Best Regards, Ricardo Marcelino
Hello guys,
I solved that problem changing this information below:
I changed the value it was 4.6.1 to 4.5
Best Regards, Abdul Hadi
is working on a reply...