Create diagnostic which will check that PXLocalizable
static classes contain only string constants
#433
Labels
enhancement
New feature or request
good first issue
Good for newcomers
static analysis
Items related to static code analysis
Internal number: ATR-590
Create diagnostic which will check that
PXLocalizable
static classes contain only string constants. The presence of constants of other type leads to an error during translations initialization in the static constructor ofPXMessages
class in platform which assumes that such class can contain only string constants. This results in all localized messages in assembly being not loaded by platform including other classes withPXLocalizable
attribute.Also is duplicated by another issue ATR-190:
As it has been reported in AC-117375: whenever a class that is decorated with
PXLocalizableAttribute
contains a non-string constant, the Collect Strings operation would fail with aSystem.InvalidCastException: 'Unable to cast object of type 'XXX' to type 'System.String'.'
To let developers know about such issues way in advance, a new diagnostic should be added in Acuminator to prevent declaration of non-string constants in a class that is decorated with
PXLocalizableAttribute
:The text was updated successfully, but these errors were encountered: