Local String Resource Problems

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
1 年間の 前
RE: "... trap the T function in the Try-Catch block..."

The 'exception' may not have any more info in the message.  I recommend you set a breakpoint in here:
\Libraries\Nop.Services\Localization\LocalizationService.cs
public virtual async Task<string> GetResourceAsync(string resourceKey)

and then step through the code to see what is happening.
1 年間の 前
New York wrote:
RE: "... trap the T function in the Try-Catch block..."

The 'exception' may not have any more info in the message.  I recommend you set a breakpoint in here:
\Libraries\Nop.Services\Localization\LocalizationService.cs
public virtual async Task<string> GetResourceAsync(string resourceKey)

and then step through the code to see what is happening.


thanks a lot
In HomeController, I solved the problem by adding some code in the Index method to load LocalStringResources in the cache memory. But I still have a question as to why this problem only happened to me during these years and apparently it is not a common problem. Right from version 4.40 onwards.

I will do your suggestion and give feedback if I get results.
Regards
1 年間の 前
What is the value of "localizationsettings.loadalllocalerecordsonstartup" setting?
1 年間の 前
RomanovM wrote:
What is the value of "localizationsettings.loadalllocalerecordsonstartup" setting?


the value of localizationsettings.loadalllocalerecordsonstartup    by default is true.

Important Tip is that in 4.30 Version in below Path the value of DefaultAdminLanguageId Is:

CodeFirstInstallationService->InstallSettings-> ->SaveSettingAsync  -> LocalizationSettings ->
DefaultAdminLanguageId = _languageRepository.Table.Single(l => l.Name == "English").Id,

But From 4.40 version to  upward the Value of DefaultAdminLanguageId Is:

InstallationService-> InstallSettingsAsync-> SaveSettingAsync -> LocalizationSettings ->
DefaultAdminLanguageId = _languageRepository.Table.Single(l => l.LanguageCulture == NopCommonDefaults.DefaultLanguageCulture).Id,

Do you think it is the root of problem?
(As I mentioned, I am facing this problem from version 4.40 and up)
1 年間の 前
NopCommonDefaults.DefaultLanguageCulture is just a string for
   .... DefaultLanguageCulture => "en-US";

I don't think that would cause your problem.  No one has ever reported this problem before.  It seems to be related to the caching.  However the way caching works is that if the 'key' is not found in the cache, then the data gets automatically reloaded form the database (and again stored in the cache).   It seems as if your 'key' is found, but the 'value' is blank / broken.  

You should again check your System > Log for errors (besides the "Resource string (...) is not found. Language ID = 1",

But I think the only way you will resolve this is using the Visual Studio debugger.  As per above, set a breakpoint, and then step through the code.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.