Date format in Russian language?

Hi ,
I am using Aspose.words for java .I inserted a date field to a document by this way

DocumentBuilder builder = new DocumentBuilder(doc);
builder.insertField("DATE \@ "dddd, MMMM d, YYYY" \* MERGEFORMAT", "");

.It worked well. But while doing it in service level, the exported document contains the date format in ‘Russian language’ why ? what could be the reason ? Am i doing any wrong ?
for example :
Saturday, September 19, 2009
it getting exported as

<style type="text/css">
<!--
	@page { size: 21cm 29.7cm; margin: 2cm }
	P { margin-bottom: 0.21cm }
--></style><sdfield type="DATETIME" sdnum="16393;1049;DDDD, MMMM D, YYYY">     суббота, Сентябрь 19, 2009</sdfield>

Do help me .

Thanks in advance

Hi

Thanks for your inquiry. This might occur because in your template Russian locale is specified or you have specified it in your code. Please see the following link for more information:
https://reference.aspose.com/words/net/aspose.words/font/localeid/
Here is code I used for testing:

// Create empty document and DocumentBuilder
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
// Insert DATE field.
builder.insertField("DATE \\@ \"dddd, MMMM d, YYYY\" \\* MERGEFORMAT", "");
// Save output document
doc.save("C:\\Temp\\out.doc");
In this case, date in the output document is displayed in English. This is by default. But if you specify locale in your code, date will be displayed in language you specified. For example:
// Create empty document and DocumentBuilder
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
// Set Russian locale
builder.getFont().setLocaleId(1049);
// Insert DATE field.
builder.insertField("DATE \\@ \"dddd, MMMM d, YYYY\" \\* MERGEFORMAT", "");
// Save output document
doc.save("C:\\Temp\\out.doc");

In the output document date will be displayed in Russian.
Hope this helps.
Best regards.

Hi ,

Thanks for your reply.I checked my code.I ever used
(builder.getFont.setLocaleId)or (localeid)anywhere in my side.

What
could be the reason ?
Why its coming in Russian without using LocaleId ?
Atleast give suggestion to force Localeid to default .

Thanks in advance

Hi

Thanks for your inquiry. As I wrote in my previous post, this also can occur because Russian locale is set in your template document. Have you checked your document also? Please attach it here for testing.
Best regards.

Hi ,
Thanks for your response .I found out where the problem is .No problem in my side .Its happening when document is created by using

Document(java.lang.String fileName)

or

Document(java.io.InputStream stream, java.lang.String baseUri)

Here is my code .

Document doc=new Document("test.html");
DocumentBuilder builder = new DocumentBuilder(doc);
builder.insertField("DATE \@ "dddd, MMMM d, YYYY" \* MERGEFORMAT", "");
doc.save("Testing.doc");

test.html :
-----------

Testing

What i get is Russian Date …

How can i solve this issue ?

Thanks in advance

Hi

Thank you for additional information. I managed to reproduce the problem on my side. You will be notified as soon as it is resolved.
As a workaround you can specify LocaleId explicitly in your code.
Best regards.

The issues you have found earlier (filed as 10652) have been fixed in this update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.
(1)