Hi, Francis,
I can't speak for RSA, but the MDT UML2 API provides a
UML2Util::getString(...) API that will retrieve a localized string from
the *.properties file accompanying the Resource that contains the
contextual element passed to the getString(...) operation.
This is used in the implementation of the NamedElement::getLabel() API for
localized names, but works with any old string key in the *.properties
file. Just be sure to match the *.properties file name with the file name
of your model (without the extension).
You could, then, simply implement the Eclipse PDE convention of
%key
as the text of your documentation field, strip off the % sign, and look up
the key in the *.properties file using getString.
HTH,
Christian
Francis wrote:
Hi,
I'm using RSA as my UML tool, and I need to be able to define
descriptions of some UML elements (E.g., a UML Class) in different
languages. There's only one documentation property for a given element,
and to be able to enter the descriptions I have to use delimiters of some
sort, with the language/locale code as the key. This is not a user
friendly way and is prone to mistyping the language code. There has to be
a better way of doing this...
First thing I tried, is I defined a UML Class in my profile, that
contains 2 attributes: 1) language code (enumeration), and 2) description
text. Then I set this as the type for my Stereotype property. It works,
but the support for this type of structure is not nice. Adding a new
description using the Properties view is a pain, and I have trouble
getting the values programmatically because I get a DynamicEObjectImpl
and I don't know how to get the actual values. :( Anyone has a better
idea? Will there be built-in support for this in the future?
Thanks,
Francis