mailtodanish

How to set Locale for Greek , Chinese Traditional , Chinese Simplified

0 votes
Below is not working localeLang = new Locale("el"); // Greek localeLang = new Locale("zh-TW"); // China Traditional localeLang = new Locale("zh-CN"); // CHina Simplified I have to add these languages in package. Greek one is also not working.

Reply to: How to set Locale for Greek , Chinese Traditional , Chinese Simplified

0 votes
Hi Danish, For Traditional and Simplified Chinese, use follow two lines instead:
		   .withLanguage(new Locale("zh","TW"))
		   .withLanguage(new Locale("zh","CN"))
Here's some code snippet from Java SDK source code:
        if (sdkPackage.getLanguage() != null) {
            String languageCountry = sdkPackage.getLanguage().getCountry();
            result.setLanguage(sdkPackage.getLanguage().getLanguage() + (isNotBlank(languageCountry) ? "-" + languageCountry : EMPTY));
        }
From where we can see if you input "zh-TW", the source code will output "zh-tw" in the end. So, directly set language country for your Locale. For Greek, .withLanguage(new Locale("el")) works properly at my side, could we double check it and if the issue remains, you could share a package id to me and we'll investigate it further. Hope this could help! Duo

Duo Liang OneSpan Evangelism and Partner Integrations Developer


Reply to: How to set Locale for Greek , Chinese Traditional , Chinese Simplified

0 votes
Hi, I tried but not working for Chinese. below is package : DJNZfrflLrviY_cQ8poUWIRsteE= e0qQ0AMIkuu0ldG4pn2CGmsxZy8= Could you please try from your side. It is showing English only not chinese.

Reply to: How to set Locale for Greek , Chinese Traditional , Chinese Simplified

0 votes
Hi there, I've checked the two packages you provided, the package level language settings are not set up properly. (both in en) But the same code works fine at my side:
	public static void main(String[] args) {
		final String API_KEY = "your_api_key";
		final String API_URL = "https://sandbox.esignlive.com/api";
		
		EslClient eslClient = new EslClient(API_KEY, API_URL);

		DocumentPackage pkg1 = PackageBuilder.newPackageNamed("Example Package " + System.currentTimeMillis())
				.withSigner(SignerBuilder.newSignerWithEmail("[email protected]")
						.withFirstName("John")
						.withLastName("Smith"))
				.withDocument(DocumentBuilder.newDocumentWithName("document 1")
						.fromFile("your_file_path")
						.withSignature(SignatureBuilder.signatureFor("[email protected]")
								.onPage(0)
								.atPosition(100, 100)
								.withSize(250, 75))
						)
				.withLanguage(new Locale("zh", "CN"))
				.build();

		PackageId createPackageOneStep = eslClient.createPackage(pkg1);
		System.out.println(createPackageOneStep);
		eslClient.sendPackage(createPackageOneStep);

	}
Could you simply try the code snippet above in a main function? Duo

Duo Liang OneSpan Evangelism and Partner Integrations Developer


Hello! Looks like you're enjoying the discussion, but haven't signed up for an account.

When you create an account, we remember exactly what you've read, so you always come right back where you left off