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);
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 2 11184
"Robin Tucker" <id*************************@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
Superb thankyou.
"Armin Zingler" <az*******@freenet.de> wrote in message
news:uq**************@tk2msftngp13.phx.gbl... "Robin Tucker" <id*************************@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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: infobahn |
last post by:
printf("%p\n", (void *)0); /* UB, or not? Please explain your answer. */
|
by: baumann |
last post by:
hi all,
i hope
printf("%#04x\n", 0);
will output 0x00,
but visual c++ studio 6 outputs 0000.
how can i get 0x00?
thanks
|
by: geek |
last post by:
Hi all,
Why does a printf("%d") statement prints this as output and when I do
printf("%c") it doesn't print anything.
-13361016
Any help would be appreciated.
Thanks,
|
by: Jude |
last post by:
here is the source code:
#include<stdio.h>
int main()
{
float f;
scanf("%d%f",&f);
printf("The float is %10.5f\n",f);
return 0;
}
when I input 12345.11111,the output is 12345.11133.
|
by: v4vijayakumar |
last post by:
why the following statement dumps the core(Segmentation fault)?
printf("%s\n", __FILE__);
| |
by: lovecreatesbeauty |
last post by:
Is parameter type conversion required for the 2nd argument on
printf("%p", (void *)&i); ?
But one would never call memcpy like:
memcpy((void *)pi, (void *)pj, sizeof *pj);
/*memcpy((void *)pi,...
|
by: Spidey |
last post by:
for(;0;)
printf("hello");
even the condition s wrong i get a hello printed on the screen
y s this happening
|
by: Gernot Frisch |
last post by:
Hi,
class MyString
{
char* m_data;
public:
MyString(const char* c)
{
m_data = new char;
strcpy(m_data, c);
|
by: Ioannis Vranos |
last post by:
Is printf("%ls") for printing wchar_t strings defined in C90, or it was
added in C95?
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |