Sunday, 15 June 2014

Is there a way to use GWT static string i18n with server-provided properties? -



Is there a way to use GWT static string i18n with server-provided properties? -

i searching solution tricky question. utilize gwt static string internationalization, using constants, constantswithlookup , messages, strings must come server @ runtime, instead compile time.

is there project such thing, or should write own gwt generators?

thanks help me.

update: dictionary not option, because application finish , cannot alter application this.

update 2: in fact dictionary alternative if wrapped costants-like or messages-like interface.

what inquire not static i18n @ all. of reasons why gwt's i18n virtually static:

it synchronous api. fetching resources server either require async api spread throughout entire application (ie, passing future widget telling inner text 1 time string has been fetched server) or have block execution of app until i18n resources have been downloaded @ origin (which give poor experience users). we can optimize generated code include formatters , associated info needed messages in app. if don't include plural messages, don't have include code, etc. expressions can inlined, dead code removed, , class references removed exclusively in cases. we can create utilize of things @ compile time hard or expensive @ runtime. example, parsing message format strings takes fair amount of code, , none of needs included in compiled output. let's fetch strings app server, , find 1 of them has {0,localtime,ymd} in -- need icu4j in order localize -- oops! if compiled js, huge. perhaps can back upwards subset of gwt's i18n in way, have include every formatter might perchance referenced message, though of them never be.

if want dynamic i18n, other answers suggest , utilize dictionary (note won't able localize app if has complexity messages). if need more can provided that, bite bullet , utilize static i18n.

gwt

No comments:

Post a Comment