šŸ› Restore ability to change languages on-the-fly
authorDavid ā€˜Bombeā€™ Roden <bombe@pterodactylus.net>
Sun, 6 Jun 2021 09:13:13 +0000 (11:13 +0200)
committerDavid ā€˜Bombeā€™ Roden <bombe@pterodactylus.net>
Sun, 6 Jun 2021 09:13:13 +0000 (11:13 +0200)
Hieronymus (sone://-wFZ6ezwU3QgvM1u8~uiLbtjxSQ19tuqn4Q94lvTrwE) noticed that
changing the language in Fredā€™s web interface didnā€™t change Soneā€™s language
anymore.

Part of my (ongoing) restructuring of Soneā€™s source code is abstracting away
all the parts that are hard to test, i.e. every interaction with Freenet
itself and the translation mechanisms are a part of that. So when I introduced
a Translation object I completely forgot that itā€™s possible to change the
language during runtime.

Luckily that is easily solvable using a Supplier instead of the concrete
BaseL10n object. In theory that does have a performance impact (because now
there are at least two more function calls involved per translation) but I am
quite confident that the additional time actually used by this is far below
the 1-ms range so I am not worried about it.


No differences found