-
Notifications
You must be signed in to change notification settings - Fork 0
Messages and Resources
SoftFluent Modeler supports localization thanks to the message concept. Even though its use is quite simple, the message concept has multiple facets which we'll describe in this section.
Messages represent text resources in the .NET sense. It means that declaring a message in your model will (depending on producers’ configuration) generate an entry in the generated resource file (a .resx file). There are two types of messages:
-
Global: in this case they are not associated with a concept (such as entity or enumeration) but are global to the project. These messages have a defined, global and unique name so they can be accessed from anywhere in the project.
-
Local: in this case they are sub concepts of a given concept (such as entity or enumeration). They don’t have a name since their name will be implicitly defined by the inference engine.
Messages have a class attribute which lets developers specify a class to a message. This attribute is made to group a set of messages that can afterwards be used to produce something. CodeModeler uses some internal classes to organize messages (_default, _plural, _doc), but you can also define your own classes for custom needs.
-
_default: If no class is specified (which is by default), all classes are grouped in _default class.
-
_plural: can be used to define the plural form of a message. This is particularly handy when coding UI producers. By default, one could decide to append an 's' to the object name to handle the plural form. This works most of the time, but in some cases the plural form can be irregular (mouse, mice, etc.). In such cases, and to avoid writing any custom code, one can indicate the plural form directly in the model to use to avoid misspellings in the generated code.
-
_doc: declaring a message in the _doc class will produce a code remark on the parent node in the Business Object Model (BOM).
-
<Custom class>: what CodeModeler does by using internal classes, you could do the same with your own classes. Say for instance, we want to generate a help document which will contain all given messages. To group desired messages developers can specify a new class on their messages.
In the following example, we have added entity resources for two cultures/languages to 3 entities and we can see the Resources Editor open on the Product entity:
Resources such as these are local messages (they are bound to the entity concept).
- Introduction
- Architect Guide
- Concepts
- Using Visual Studio
- Overview
- Creating a CodeModeler Project
- Visual Environment
- Project Hierarchy
- Design Surface
- Customizing Design Surfaces
- Ribbon Bar
- Property Grid
- Member Format Expressions
- Model Grid
- Method Editor
- View Editor
- Instance Editor and Grid
- Resources Editor
- Inferred Model Viewer
- Building
- Project Physical Layout
- Source Control Support
- Generating
- Aspect Oriented Design (AOD)
- Developer Guide
- The Business Object Model (BOM)
- CodeModeler Query Language (CMQL)
- Starting Guide - Tutorial
- Upgrade From CFE