|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
"printf" style string method?string due to localisation, is it possible to build a string using a "printf" style function, such that the source string can also contain the position of the elements to follow? Eg. : printf ( "Your database is marked as version %d, but this client requires a schema version %d" or later", dbVersion, dbRequiredVersion); where in another locale, we might rearrange this sentance to something like: printf ( "Your database is marked %d as the version, but this client requires a %d schema version or later", dbVersion, dbRequiredVersion); ie: the grammatical rules for different languages are not neccessarily those of English. At present, I've got resource strings that are just breaking up the sentances, which I recombine with things like: theString = "Your database is marked as version " + dbVersion.ToString + ", but this client requires a schema version " + dbRequiredVersion.ToString Now, although these fragments can be translated, I don't see how it's possible to alter the ordering as might be required - ..... Is there a method or algorithm analogous to printf I can use in VB? Cheers Robin
Show quote
Hide quote
"Robin Tucker" <idontwanttobespammedanymore@reallyidont.com> schrieb s = string.format("Your database is marked as version {0}, but this client > > Given the need to (possibly) alter the position of various elements > in a string due to localisation, is it possible to build a string > using a "printf" style function, such that the source string can > also contain the position of the elements to follow? Eg. : > > printf ( "Your database is marked as version %d, but this client > requires a schema version %d" or later", dbVersion, > dbRequiredVersion); > > where in another locale, we might rearrange this sentance to > something like: > > printf ( "Your database is marked %d as the version, but this > client requires a %d schema version or later", dbVersion, > dbRequiredVersion); requires a schema version {1}" or later", dbVersion, dbRequiredVersion) Armin Superb thankyou.
Show quoteHide quote "Armin Zingler" <az.nospam@freenet.de> wrote in message news:uq5WGlYfFHA.3912@tk2msftngp13.phx.gbl... > "Robin Tucker" <idontwanttobespammedanymore@reallyidont.com> schrieb >> >> Given the need to (possibly) alter the position of various elements >> in a string due to localisation, is it possible to build a string >> using a "printf" style function, such that the source string can >> also contain the position of the elements to follow? Eg. : >> >> printf ( "Your database is marked as version %d, but this client >> requires a schema version %d" or later", dbVersion, >> dbRequiredVersion); >> >> where in another locale, we might rearrange this sentance to >> something like: >> >> printf ( "Your database is marked %d as the version, but this >> client requires a %d schema version or later", dbVersion, >> dbRequiredVersion); > > > > s = string.format("Your database is marked as version {0}, but this client > requires a schema version {1}" or later", dbVersion, dbRequiredVersion) > > > > Armin
System.Web.Mail.Smtp namespace
INI or XML manged alternative to get the complete text from each open window Get names of opened windows and their process name Adding desktop shortcuts and start program entries ApplicationDomains Intellisense question Calculating Time in VB .Net reference dependency warnings during build is there way to send email throught outlook express without mapi controls ? |
|||||||||||||||||||||||