Multilingual string

This component defines a multilingual string as a collection of plain strings with the same meaning but in different languages. The collection is an object that implements the Translatable interface.

Immutability

The Translatable interface does not declare methods that can modify the object. The default implementation of this interface provided by this library is also immutable.

Custom implementations of Translatable interface do not need to be immutable, even though it’s recommended.

Instantiation

Use of factory class is recommended over direct instantiations of Translatable implementors. You should either use the MultilingualStringFactory or implement your own using the interface TranslatableFactoryInterface.