Report internationalization

Hi,

I know this is quite a broad question: does Aspose.Words for Java provide any tool in order to internationalize reports, for example through mail-merge or similar?

This would allow us to prepare a standard report, and then have it filled in different languages!

Hi Matteo,

Thanks for your inquiry. Please note that Aspose.Words mimics the same behavior as MS Word does.

Yes, Aspose.Words supports multilingual documents. You can manipulate with such document or create them from scratch. You can use Font.LocaleId property to specify language that will be used by MS Word.

It would be great if you please share some more detail about your query. We will then provide you more information about your query.

I’ll make you some examples of what I’d need:

  1. Suppose that I am mail-merging a date string on a field called <<start_date>>, would it be possible to have that date automatically formatted based on current locale?
  2. How could I go about translation of “static” parts? Would you suggest making multiple version of the same document in different languages, or would it be possible to have Aspose.Words automatically call some kind of callback at merge time?

Hi Matteo,

Thanks
for your inquiry.

mtassinari:

  1. Suppose that I am mail-merging a date string on a field called <<start_date>>, would it be possible to have that date automatically formatted based on current locale?

You can make use of FieldOptions.FieldUpdateCultureSource property to achieve this. It is used to specify what culture to use to format the field result.

Please
note that by default, the culture of the current thread is used and
this setting affects only date/time fields with @ format switch.

For
exmaple, the following code snippet shows how to specify where the
culture used for date formatting during field update and mail merge is
chosen from.

// Set the culture used during field update to the culture used by the field.
doc.FieldOptions.FieldUpdateCultureSource = FieldUpdateCultureSource.FieldCode;
doc.MailMerge.Execute(new string[] { “Date2” }, new object[] { new DateTime(2011, 1, 01) });

mtassinari:

  1. How could I go about translation of “static” parts? Would you suggest making multiple version of the same document in different languages, or would it be possible to have Aspose.Words automatically call some kind of callback at merge time?

Aspose.Words supports multilingual documents. You can merge multilingual documents into one document. However, Aspose.Words does not support translation of text.