Let's say I have a
Book that has it's
description localized in any number of languages.
Localization only matters for e.g. administrators, because users chooses their localization and they need to see only their localization, not all of them. Administrators, however, needs to have full support for localization management.
I would have two entities for this:
Book - that is localized for the user. The repository would be aware of localization, so we don't even need to pass current localization all the time.
Then, I will have another entity:
Book2 (yeah, needs a better name) that will contain a
Map<Locale, String> instead of simple string for a
title. This entity would be use in 'admin' context.
I also do not see a way to make both Books to be of the same type.
Would this be a good approach? Any wisdom on this?