Configure Language

The following guide shows you how to configure the language at both package/transaction and signer level.

Below are the languages and their abbreviations available in OneSpan Sign:

  • English(en)
  • Danish(da)
  • German(de)
  • Spanish(es)
  • French(fr)
  • Italian(it)
  • Dutch(nl)
  • Portuguese(pt)
  • Polish(ru)
  • Chinese Simplified(zh-CN)
  • Chinese Traditional(zh-TW)
  • Japanese(ja)
  • Korean(ko)
  • Greek(el)

Package Level

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

DocumentPackage pkg = PackageBuilder.newPackageNamed("Example Package " + System.currentTimeMillis())
        .withLanguage(Locale.FRENCH)
        ......
        .build();

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

Signer Level

Similarly, you can specify different languages in signer level. Below is an example on how to build your Signer object with language setting:

Note that signer level setting will overwrite the package level language setting.

Signer signer2 = SignerBuilder.newSignerWithEmail("signer2@mailinator.com")
        .withLanguage(Locale.FRENCH)
        ......
        .build();

The Code

Here’s an example showing you how to build a package with both package and signer level language setting.

DocumentPackage superDuperPackage = PackageBuilder.newPackageNamed("Package Language Example")
                .describedAs("This is a package created using the OneSpan Sign SDK")
                .withLanguage(Locale.ENGLISH)
                .withSigner(SignerBuilder.newSignerWithEmail("signer1@mailinator.com")
                        .withFirstName("John")
                        .withLastName("Smith")
                        .withTitle("Managing Director")
                        .withCompany("ABC Bank"))
                .withSigner(SignerBuilder.newSignerWithEmail("signer2@mailinator.com")
                        .withFirstName("Mary")
                        .withLastName("Doe")
                        .withTitle("Applicant")
                        .withCompany("Acme Inc.")
                        .withLanguage(Locale.ENGLISH)
                          )
                .withDocument(DocumentBuilder.newDocumentWithName("First Document")
                        .fromFile("your_file_path")
                        .withSignature(SignatureBuilder.signatureFor("signer1@mailinator.com")
                                .onPage(0)
                                .atPosition(100, 100))
                        .withSignature(SignatureBuilder.signatureFor("signer2@mailinator.com")
                                .onPage(0)
                                .atPosition(200, 100)))
                .build();

Get the Code

Below are the languages and their abbreviations available in OneSpan Sign:

  • English(en)
  • Danish(da)
  • German(de)
  • Spanish(es)
  • French(fr)
  • Italian(it)
  • Dutch(nl)
  • Portuguese(pt)
  • Polish(ru)
  • Chinese Simplified(zh-CN)
  • Chinese Traditional(zh-TW)
  • Japanese(ja)
  • Korean(ko)
  • Greek(el)

Package Level

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

DocumentPackage pkg = PackageBuilder.NewPackageNamed("Example Package " + System.DateTime.Now)
        .WithLanguage("fr")
        ......
        .Build();

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

Signer Level

Similarly, you can specify different languages in signer level. Below is an example on how to build your Signer object with language setting:

Note that signer level setting will overwrite the package level language setting.

Signer signer2 = SignerBuilder.NewSignerWithEmail("signer2@mailinator.com")
        .WithLanguage("fr")
        ......
        .Build();

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("en")
                   .ExpiresOn(DateTime.Now.AddMonths(1))
                   .WithEmailMessage("This message should be delivered to all signers")
                   .withSigner(SignerBuilder.NewSignerWithEmail("signer1@mailinator.com")
                        .WithFirstName("John")
                        .WithLastName("Smith")
                        .WithTitle("Managing Director")
                        .WithCompany("ABC Bank"))
                   .withSigner(SignerBuilder.NewSignerWithEmail("signer2@mailinator.com")
                        .WithFirstName("Mary")
                        .WithLastName("Doe")
                        .WithTitle("Applicant")
                        .WithCompany("Acme Inc.")
                        .WithLanguage("fr")
                          )
                   .WithDocument(DocumentBuilder.NewDocumentNamed("First Document")
                                 .FromFile("your_file_path")
                                 .WithSignature(SignatureBuilder.SignatureFor("signer1@mailinator.com")
                                 .OnPage(0)
                                 .AtPosition(100, 100))                              
                                 .WithSignature(SignatureBuilder.SignatureFor("signer2@mailinator.com")
                                 .OnPage(0)
                                 .AtPosition(200, 100)))
                   .Build();

Get the Code

Below are the languages and their abbreviations available in OneSpan Sign:

  • English(en)
  • Danish(da)
  • German(de)
  • Spanish(es)
  • French(fr)
  • Italian(it)
  • Dutch(nl)
  • Portuguese(pt)
  • Polish(ru)
  • Chinese Simplified(zh-CN)
  • Chinese Traditional(zh-TW)
  • Japanese(ja)
  • Korean(ko)
  • Greek(el)

The Code

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

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",
  "roles": [
    {
      "id": "Signer1",
      "type": "SIGNER",
      "signers": [
        {
          "id": "Signer1",
          "firstName": "John",
          "lastName": "Smith",
          "email": "signer1@mailinator.com"
        }
      ],
      "name": "Signer1"
    },
    {
      "id": "Signer2",
      "type": "SIGNER",
      "signers": [
        {
          "id": "Signer2",
          "firstName": "Mary",
          "lastName": "Doe",
          "email": "signer2@mailinator.com",
          "language": "en"
        }
      ],
      "name": "Signer1"
    }
  ],
  "type": "PACKAGE",
  "name": "Example Package"
}

------WebKitFormBoundary1bNO60n7FqP5WO4t--

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
language string Yes No en en / fr / es …

Below are the languages and their abbreviations available in OneSpan Sign:

  • English(en)
  • Danish(da)
  • German(de)
  • Spanish(es)
  • French(fr)
  • Italian(it)
  • Dutch(nl)
  • Portuguese(pt)
  • Polish(ru)
  • Chinese Simplified(zh-CN)
  • Chinese Traditional(zh-TW)
  • Japanese(ja)
  • Korean(ko)
  • Greek(el)

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