我有一个WinForms应用程序,我目前正在实施的翻译引擎我至今是一堆下面的语法类似的文本文档。设置文本动态
messages.manualupdate="There is a manual update available for ProgName.\n\nDo you want to update to version {0}.{1}.{2}{3}?"
messages.errorcopy="Clicking OK will copy the error so you can paste it elsewhere!"
messages.error="Error"
messages.notsupported.title="Unsupported client"
messages.notsupported.message="This version is no long supported. Please wait for an update."
我有很多的这些不同的语言,例如:
messages.manualupdate="é disponibile un'aggiornamento manuale del programma ProgName.\n\nVuoi aggiornare alla versione {0}.{1}.{2}{3}?"
messages.errorcopy="Cliccando OK eseguirete una copia degli errori visualizzati"
messages.error="Error"
messages.notsupported.title="Client non supportato"
messages.notsupported.message="Questa versione non è utilizzabile al momento. attendi il prossimo aggiornamento!"
我再解析为DynamicObject
,我可以访问诸如language.messages.notsupported.error
这一点。我想知道的是,如果我可以以某种方式链接表单上的所有控件,以便在创建时使用来自动态对象的变量。例如,我在窗体上有一个按钮,我想在其中显示文本“错误”。在窗体显示之前,我将language
变量设置为用户选择的语言,然后当窗体显示它仅从language
加载文本。有没有办法在设计器中这样做,而不必编写一个在Forms构造函数中调用的方法,因为在我看来,将所有按钮文本设置为一个值然后将其全部更改当表单加载时。我正在寻找一种绑定,但对于控件Text参数。
任何人有任何想法?