CardText localization

Hi!

CardText is locale aware, but the example showed here is not thread safe, it modifies a global variable.
How can I tell at field level which locale I wan to use? I found that I had to use

doc.getFieldOptions().setFieldUpdateCultureSource(FieldUpdateCultureSource.FIELD_CODE); 

but I dont find how to set the locale for a field.

Hi Kálmán,

Thanks for your inquiry.

I would suggest you please upgrade to the latest version of Aspose.Words for Java 17.1.0 and see how it goes on your side. I hope, this helps. You can download it from the following link:
https://downloads.aspose.com/words/java

In case the problem still remains, please create a standalone simple Java Application (source code without compilation errors) that helps us reproduce your problem on our end and attach it here for testing. Also, please attach sample Word document you’re getting this problem with here for testing. Also, please tell what are your default regional/cultural settings? As soon as you get this simple application ready, we will start further investigation into your issue and provide you more information.

Best regards,

My problem is not with an actual code/template, but how to write the code itself. I cannot give you any code or template.

Hi Kálmán,

Thanks for your inquiry. We have logged your requirement in our issue tracking system. The ID of this issue is WORDSNET-14745. Our product team will further look into the details of this problem and we will keep you updated on the status of this issue. We apologize for your inconvenience.

Best regards,

The issues you have found earlier (filed as WORDSNET-14745) have been fixed in this Aspose.Words for .NET 17.3.0 update and this Aspose.Words for Java 17.3.0 update.


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

Hi!

When I call Field.setLocaleId(1038) I get “Not a valid LCID” exception.

java.lang.IllegalArgumentException: Not a valid LCID
Parameter name: value
at com.aspose.words.Field.setLocaleId(Unknown Source)
…

1038 is a valid LCID for hu-HU (hungarian).

What is the problem?

Hi Kálmán,

Thanks for your inquiry.

After an initial test with Aspose.Words 17.4, we were unable to reproduce this issue on our end. We would suggest you please upgrade to the latest version of Aspose.Words. You can download it from the following link:
http://downloads.aspose.com/words/java

In case the problem still remains, please create a standalone simple Java Application (source code without compilation errors) that helps us reproduce your problem on our end and attach it here for testing. Also, please ZIP and attach sample Word document you’re getting this problem with here for testing. Also, please tell what are your default regional/cultural settings? As soon as you get these pieces of information ready, we will start further investigation into your issue and provide you more information.

Best regards,

Hi!

I use version 17.4.
dotx file attached
default regional/cultural settings : hungarian

public class Test {

    public static void main(
            String[] args)
            throws Exception {

        System.out.println("Default locale : " + Locale.getDefault());//hu_HU
        Document doc = new Document(new FileInputStream("test.dotx"));
        doc.getMailMerge().setCleanupOptions(
                REMOVE_EMPTY_PARAGRAPHS | REMOVE_UNUSED_FIELDS | REMOVE_CONTAINING_FIELDS | REMOVE_UNUSED_REGIONS);
        doc.getMailMerge().setTrimWhitespaces(true);
        for (Field field : doc.getRange().getFields()) {
            field.setLocaleId(1038);
        }
    }
}

Hi Kálmán,

Thanks for your inquiry.

While using the latest version of Aspose.Words for Java i.e. 17.4 and your code, we managed to reproduce the following exception on our end.

Exception in thread "main" java.lang.IllegalArgumentException: Not a valid LCID
Parameter name: value
at com.aspose.words.Field.setLocaleId(Unknown Source)

We have logged this issue in our bug tracking system. The ID of this issue is WORDSJAVA-1541. Your thread has been linked to this issue and you will be notified as soon as it is resolved. Sorry for the inconvenience.

Best regards,

The issues you have found earlier (filed as WORDSJAVA-1541) have been fixed in this Aspose.Words for .NET 17.6 update and this Aspose.Words for Java 17.6 update.


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