Scope: managed applications, mobile applications, and ordinary applications.
1. Do not localize string constants with internal identifiers that are not displayed to users. Do not apply the NStr function to them. You need to name such string identifiers according to rules of naming identifiers of 1C:Enterprise language variables.
Return "OperationCompletedSuccessfully"; Notify("WriteFile", New Structure("Event", "VersionSaved"), FileRef);
If Status = "Shipment to customers", ...
If Status = "ShipmentToCustomers" Then ...
This requirement also applies when identifiers are used in query texts and DCS expressions.
When using string constants in the code, it is preferred that you apply functions that return these string constants. Such approach makes code debugging and refactoring easier.
ImportResult = ImportFileFromInternet(...); If ImportResult = ImportResultSuccessful() Then ... ElsIf ... Function ImportResultSuccessful() Return "Successful"; EndFunction
This eliminates ambiguity when an identifier in the code looks like a string displayed to a user but without the required Nstr.
2. Do not use object and type presentations in application algorithms. String presentations are used only to be displayed to users. They might vary depending on the current application language. Therefore, their use leads to errors upon localizing a configuration or integrating it with applications in other languages. Separate cases when object and type presentations are incorrectly used in the code.
If String(BusinessEntityIndividual) = "Business entity" Then
If BusinessEntityIndividual = PredefinedValue("Enum.BusinessEntityIndividual.BusinessEntity") Then