Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • info.magnolia.ui.form.field.definition.FieldDefinition#getLabel
  • info.magnolia.ui.form.field.definition.FieldDefinition#getDescription
  • info.magnolia.ui.form.definition.TabDefinition#getLabel
  • com.vaadin.ui.Component#setCaption (39 usages in the codebase I have)
  • info.magnolia.ui.dialog.FormDialogPresenterImpl#buildView
  • ...

MessagesManager implementation

info.magnolia.cms.i18n.MessagesManager is the component that has been used to handled i18n up until Magnolia 4.5. It has its flaws, and could be rewritten.

  • it tries to cover too many use-cases (either enforce passing a Locale, or never pass one)
  • its responsibilities are not clear - it observes and holds some i18n config (but not all?) and at the same time provides translation support
  • DefaultMessagesManager is still very tied to using property files.
  • DefaultMessagesManager isn't cleanly decoupled from the system - it's still using content2bean "manually", etc; it's not a real "component".
  • rething package name and/or class name (package mixes i18n for UI and for content, to start with...)
  • It's not easy to test
  • Some logic is burried in the MessagesChain class - which is where, for instance, we've been appending the ??? when a key wasn't found so far. Except that we've seen workarounds popup here and there to remove those, etc..
  • info.magnolia.cms.i18n.MessagesUtil proposes too many methods; as a result, we're completely inconsistently use those in many places in our code. Get rid of this.
  • http://jira.magnolia-cms.com/issues/?jql=text%20~%20%22messagesmanager%22%20and%20resolution%3DUnresolved

Existing uses and inconsistencies

See #status.

 

Proposal

This concept and proposal focuses on in-configuration translations. Hopefully, the concepts can be applied to in-code translations. In-template translations will be taken into account (i.e facilitate the maintenance of the corresponding message files), but changing the mechanism they use might be considered a "next step".

...