-
Currently, there doesn't seem to be an easy approach to "reloading" localization on all open documents; I'm implementing our options menu but I'm unsure what the approach would be to changing languages on the fly without needing to completely dump all of the active documents and somehow manually set up the focus states of prior documents (ie, Main Menu -> Options -> Languages submenu has the drop-down, so if you select a new language hitting back re-focuses on Languages, hitting back again re-focuses on Options. That part works but if I dump all of the loaded documents that won't automatically function I don't think). Is there some way to re-fetch the original, unlocalized strings in the document so I can just iterate the docs and re-translate elements? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
The library doesn't store the original strings anywhere, so, no it's not possible to fetch them. I think your best bet is to reload the documents. One alternative I could think of is to set the original string in each element's attributes, and make your own setup for applying the translated string into the document. But that seems a bit cumbersome to work with. Another one is to make a hidden sub-element for every translated string, with the original string in that element, that you somehow read and re-apply. I don't think I would recommend any of these two approaches though. |
Beta Was this translation helpful? Give feedback.
You could get the focus node of each document, and store that before reloading, see
Element::GetFocusLeafNode
. If there still are some issues, a more stable but somewhat more invasive alternative, is to prompt the user about the interface being reloaded, and then just don't try to re-focus everything but just get to a stable state. I think that is reasonable, this wouldn't normally be an option that is changed too often.