Configure Package Language

The following guide shows you how to configure the language for a package/transaction.

Below are the following languages available in OneSpan Sign:

  • English
  • Danish
  • German
  • Spanish
  • French
  • Italian
  • Dutch
  • Portuguese
  • Polish
  • Chinese Simplified
  • Chinese Traditional
  • Japanese
  • Korean
  • Greek

The Code

The sample Java code below shows you how to edit the DocumentPackage object in order to change the package/transaction language:

DocumentPackage superDuperPackage = PackageBuilder.newPackageNamed("Package Language Example")
                .describedAs("This is a package created using the OneSpan Sign SDK")
                .withLanguage(Locale.FRENCH)
                .withSigner(SignerBuilder.newSignerWithEmail("mail30@mailinator.com")
                        .withFirstName("John")
                        .withLastName("Smith")
                        .withTitle("Managing Director")
                        .withCompany("Acme Inc."))
                .withDocument(DocumentBuilder.newDocumentWithName("First Document")
                        .fromFile("C:/Users/hhaidary/Desktop/PDFs/doc1.pdf")
                        .withSignature(SignatureBuilder.signatureFor("mail30@mailinator.com")
                                .onPage(0)
                                .atPosition(100, 100)))
                .build();

Note that the language is on a package/transaction level. The language will be changed for all signers/recipients involved in the transaction.

Get the Code

Below are the following languages available in OneSpan Sign:

  • English
  • Danish
  • German
  • Spanish
  • French
  • Italian
  • Dutch
  • Portuguese
  • Polish
  • Chinese Simplified
  • Chinese Traditional
  • Japanese
  • Korean
  • Greek

The Code

The sample C# code below shows you how to edit the DocumentPackage object in order to change the package/transaction language:

DocumentPackage superDuperPackage = PackageBuilder.NewPackageNamed("Package Language Example")
               .DescribedAs("This is a package created using the OneSpan Sign SDK")
               .WithLanguage(new CultureInfo("fr"))
                   .ExpiresOn(DateTime.Now.AddMonths(1))
                   .WithEmailMessage("This message should be delivered to all signers")
                   .WithSigner(SignerBuilder.NewSignerWithEmail("mail30@mailinator.com")
                               .WithFirstName("John")
                               .WithLastName("Smith"))
                   .WithDocument(DocumentBuilder.NewDocumentNamed("First Document")
                                 .FromFile("C:/Users/hhaidary/Desktop/PDFs/doc1.pdf")
                                 .WithSignature(SignatureBuilder.SignatureFor("mail30@mailinator.com")
                                  .OnPage(0)
                                  .AtPosition(100, 100)
                                  .WithField(FieldBuilder.TextField()
                              .OnPage(0)
                              .AtPosition(400, 100)
                              .WithSize(200, 50))))
                   .Build();

Note that the language is on a package/transaction level. The language will be changed for all signers/recipients involved in the transaction.

Get the Code

Below are the following languages available in OneSpan Sign:

  • English
  • Danish
  • German
  • Spanish
  • French
  • Italian
  • Dutch
  • Portuguese
  • Polish
  • Chinese Simplified
  • Chinese Traditional
  • Japanese
  • Korean
  • Greek

The Code

The request below shows you how to build your JSON payload in order to change the package/transaction language:

HTTP Request
POST /api/packages

HTTP Headers
Accept: application/json
Content-Type: multipart/form-data
Authorization: Basic api_key

Request Payload

------WebKitFormBoundary1bNO60n7FqP5WO4t
Content-Disposition: form-data; name="file"; filename="testDocumentExtraction.pdf"
Content-Type: application/pdf

%PDF-1.5
%µµµµ
1 0 obj
<>>>
endobj.... 

------WebKitFormBoundary1bNO60n7FqP5WO4t
Content-Disposition: form-data; name="payload"

{
  "status": "DRAFT",
  "language": "fr",
  "type": "PACKAGE",
  "roles": [
    {
      "id": "Signer1",
      "type": "SIGNER",
      "signers": [
        {
          "email": "mail32@mailinator.com",
          "firstName": "John",
          "lastName": "Smith",
          "id": "Signer1"
        }
      ],
      "name": "Signer1"
    }
  ],
  "name": "Example Package"
}

For a complete description of each field, take a look at the JSON Properties section below.

Response Payload

{
    "id": "9sKhW-h-qS9m6Ho3zRv3n2a-rkI="
}

Note that the language is on a package/transaction level. The language will be changed for all signers/recipients involved in the transaction.

Get the Code

JSON Properties

Property Type Editable Required Default Sample Value(s)
status string Yes No DRAFT DRAFT / SENT / COMPLETED / ARCHIVED / DECLINED / OPTED_OUT / EXPIRED
language string Yes No en en / fr / es …
type string Yes No PACKAGE PACKAGE / TEMPLATE / LAYOUT
name string Yes No n/a Example Package
roles
id string Yes No n/a Signer1
type string Yes No SIGNER SIGNER / SENDER
name string Yes No n/a Signer1
signers
email string Yes Yes n/a mail32@mailinator.com
firstName string Yes Yes n/a John
lastName string Yes Yes n/a Smith
id string Yes No n/a Signer1

Below are the following languages available in OneSpan Sign:

  • English
  • Danish
  • German
  • Spanish
  • French
  • Italian
  • Dutch
  • Portuguese
  • Polish
  • Chinese Simplified
  • Chinese Traditional
  • Japanese
  • Korean
  • Greek

The Code

The sample Apex code below shows you how to edit the Package_x object in order to change the package/transaction language:

ESignLiveSDK sdk = new ESignLiveSDK();
         
//Create package
ESignLiveAPIObjects.Package_x pkg = new ESignLiveAPIObjects.Package_x();
pkg.name = 'Test Configure Package Language - ' + Datetime.now().format();
pkg.status = ESignLiveAPIObjects.PackageStatus.DRAFT;
pkg.language = 'fr';		//configure package language
String packageId = sdk.createPackage(pkg);
System.debug('PackageId: ' + packageId);

Note that the language is on a package/transaction level. The language will be changed for all signers/recipients involved in the transaction.

Get the Code