Our experience showed that there are good reasons for such a scheme:
"resources string:''.
instead
of using the plain string.
The variable "resources" is an instance variable of ApplicationModel, thus every UI application automatically gets the required translations.
Class methods can refer to this via "self classResources"
.
If your class is not inheriting from ApplicationModel, use "self class classResources" or "self projectDefinitionClass classResources".
"resources string:'...%1..' with:argument
, which
first translates the string, then expands the %i with corresponding argumens from
the with:-list. Up to 5 parameters can be provided by with:, with:with:... methods.
More arguments are passed by the "withArguments:{ arg1 . ... argN }"
array construct.
You should never ever concatenate individually translated string pieces, because different languages may have a different word order (subject-predicate-object), and thus often require different word ordering.
For this, a string such as 'bla bla %1 and %2 with %3" can be given as UI string, and translated to a string like "%1 und %2 sowie %3 wurden bla bla".
Finally, in some cases, a resource string may spawn multiple lines,
and the newline-escape character should be escaped to linebreaks.
However, this must happen before the expansion, as otherwise MSDOS-filenames woulf
be presented in multiple lines.
For this, use the
"resources stringWithCRs:'...%1..' with:arg ...
message.
... more to come ...
Copyright © 2008 eXept Software AG, all rights reserved