fix(i18n): detect Spanish language variants for flow greeting/signoff
This commit is contained in:
parent
148c965a16
commit
26f7067cb5
|
|
@ -235,13 +235,18 @@ global with sharing class DocusignCompositeEnvelopeBuilder {
|
|||
String DIVIDER = '\n\n' + '─'.repeat(40) + '\n\n';
|
||||
|
||||
// Support English (default) and Spanish greetings/signoffs based on the
|
||||
// optional `language` input parameter (e.g. 'en' or 'es').
|
||||
// optional `language` input parameter. Flow consumers may pass locale
|
||||
// codes like 'es', 'es-CO', or user-friendly strings like 'Spanish' or
|
||||
// 'Español'. Normalize and accept common Spanish forms.
|
||||
String GREETING;
|
||||
String SIGNOFF;
|
||||
if (String.isNotBlank(req.language) && req.language.toLowerCase().startsWith('es')) {
|
||||
String lang = req.language == null ? '' : req.language.toLowerCase();
|
||||
if (lang.startsWith('es') || lang.contains('spanish') || lang.contains('espa')) {
|
||||
// Spanish
|
||||
GREETING = 'Hola,\n\nPor favor, firme la solicitud de DocuSign de parte de Intervención Temprana Colorado.\n\n';
|
||||
SIGNOFF = '\n\nGracias,\nIntervención Temprana Colorado';
|
||||
} else {
|
||||
// Default to English
|
||||
GREETING = 'Hello,\n\nPlease complete the DocuSign signature request from Early Intervention Colorado.\n\n';
|
||||
SIGNOFF = '\n\nThank you,\nEarly Intervention Colorado';
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue