Languages - NKS0045
Use CultureManager.CurrentCultStr
This analyzer provides the following strings:
Context | String |
---|---|
Error List | Caller uses |
Suggestion Box | Use |
Description |
|
Extended Description
This code analyzer detects the usage of CurrentUICulture
from the CultureInfo
class found in the System.Globalizaiton
namespace.
The CultureInfo.CurrentUICulture.Name
property gives you your current UI culture's name for your applications. However, Nitrocid is not a GUI application, so we've decided to make our own culture handler that respects your kernel settings.
It's advisable to use the CultureManager.CurrentCultStr
property so that your mod can respect the kernel settings when it comes to cultures.
Analysis Comparison
To get a brief insight about how this analyzer works, compare the two code blocks shown to you below:
Before the fix
After the fix
Suppression
You can suppress this suggestion by including it in the appropriate place, whichever is convenient.
For more information about how to suppress any warning issued by the Nitrocid analyzer, visit the below page:
Recommendation
We recommend that every caller which use this function use the recommended abovementioned method.