-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #455 from episphere/main
Dev -> Stage Sync (July 2024)
- Loading branch information
Showing
9 changed files
with
411 additions
and
380 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
import { moduleParams } from "./questionnaire.js"; | ||
|
||
export const translate = (key, replacements = []) => { | ||
|
||
let translation = moduleParams.i18n[key]; | ||
|
||
replacements.forEach((value, index) => { | ||
translation = translation.replace(new RegExp(`\\{${index}\\}`, 'g'), value); | ||
}); | ||
|
||
return translation; | ||
} | ||
|
||
export const responseRequestedModal = () => { | ||
|
||
return ` | ||
<div class="modal" id="softModal" tabindex="-1" role="dialog" aria-labelledby="softModalTitle" aria-modal="true"> | ||
<div class="modal-dialog" role="document"> | ||
<div class="modal-content"> | ||
<div class="modal-header"> | ||
<h5 class="modal-title" id="softModalTitle" tabindex="-1">${translate('responseRequestedLabel')}</h5> | ||
<button type="button" class="close" data-dismiss="modal" data-bs-dismiss="modal" aria-label="Close"> | ||
<span aria-hidden="true">×</span> | ||
</button> | ||
</div> | ||
<div id="modalBody" class="modal-body" aria-describedby="modalBodyText"> | ||
<p id="modalBodyText"></p> | ||
</div> | ||
<div id="softModalFooter" class="modal-footer"> | ||
<button type="button" id=modalContinueButton class="btn btn-light" data-dismiss="modal" data-bs-dismiss="modal">${translate('continueWithoutAnsweringButton')}</button> | ||
<button type="button" id=modalCloseButton class="btn btn-light" data-dismiss="modal" data-bs-dismiss="modal">${translate('answerQuestionButton')}</button> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
`; | ||
} | ||
|
||
export const responseRequiredModal = () => { | ||
|
||
return ` | ||
<div class="modal" id="hardModal" tabindex="-1" role="dialog" aria-labelledby="hardModalLabel" aria-modal="true" aria-describedby="hardModalBodyText"> | ||
<div class="modal-dialog" role="document"> | ||
<div class="modal-content"> | ||
<div class="modal-header"> | ||
<h5 class="modal-title" id="hardModalLabel">${translate('responseRequiredLabel')}</h5> | ||
<button type="button" class="close" data-dismiss="modal" data-bs-dismiss="modal" aria-label="Close"> | ||
<span aria-hidden="true">×</span> | ||
</button> | ||
</div> | ||
<div class="modal-body"> | ||
<p id="hardModalBodyText"></p> | ||
</div> | ||
<div class="modal-footer"> | ||
<button type="button" class="btn btn-danger" data-dismiss="modal" data-bs-dismiss="modal">${translate('answerQuestionButton')}</button> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
`; | ||
} | ||
|
||
export const responseErrorModal = () => { | ||
|
||
return ` | ||
<div class="modal" id="softModalResponse" tabindex="-1" role="dialog" aria-labelledby="softModalResponseTitle" aria-modal="true" aria-describedby="softModalResponseBody"> | ||
<div class="modal-dialog" role="document"> | ||
<div class="modal-content"> | ||
<div class="modal-header"> | ||
<h5 class="modal-title" id="softModalResponseTitle">${translate('responseErrorLabel')}</h5> | ||
<button type="button" class="close" data-dismiss="modal" data-bs-dismiss="modal" aria-label="Close"> | ||
<span aria-hidden="true">×</span> | ||
</button> | ||
</div> | ||
<div id="modalResponseBody" class="modal-body"> | ||
<p>${translate('responseErrorBody')}</p> | ||
</div> | ||
<div id="softModalResponseFooter" class="modal-footer"> | ||
<button type="button" id=modalResponseContinueButton class="btn btn-success" data-dismiss="modal" data-bs-dismiss="modal">${translate('correctButton')}</button> | ||
<button type="button" id=modalResponseCloseButton class="btn btn-danger" data-dismiss="modal" data-bs-dismiss="modal">${translate('incorrectButton')}</button> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
`; | ||
} | ||
|
||
export const submitModal = () => { | ||
|
||
return ` | ||
<div class="modal" id="submitModal" tabindex="-1" role="dialog" aria-labelledby="submitModalLabel" aria-modal="true" aria-describedby="submitModalBodyText"> | ||
<div class="modal-dialog" role="document"> | ||
<div class="modal-content"> | ||
<div class="modal-header"> | ||
<h5 class="modal-title" id="submitModalLabel">${translate('submitLabel')}</h5> | ||
<button type="button" class="close" data-dismiss="modal" data-bs-dismiss="modal" aria-label="Close"> | ||
<span aria-hidden="true">×</span> | ||
</button> | ||
</div> | ||
<div class="modal-body"> | ||
<p id="submitModalBodyText">${translate('submitBody')}</p> | ||
</div> | ||
<div class="modal-footer"> | ||
<button type="button" id="submitModalButton" class="btn btn-success" data-dismiss="modal" data-bs-dismiss="modal">${translate('submitButton')}</button> | ||
<button type="button" id="cancelModal" class="btn btn-danger" data-dismiss="modal" data-bs-dismiss="modal">${translate('cancelButton')}</button> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
`; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
const en = { | ||
"language": "en", | ||
|
||
"backButton": "Back", | ||
"resetAnswerButton": "Reset Answer", | ||
"submitSurveyButton": "Submit Survey", | ||
"nextButton": "Next", | ||
"responseRequestedLabel": "Response Requested", | ||
"responseRequiredLabel": "Response Required", | ||
"responseErrorLabel": "Response Requested", | ||
"responseErrorBody": "There is an error with this response. Is this correct?", | ||
"submitLabel": "Submit Answers", | ||
"submitBody": "Are you sure you want to submit your answers?", | ||
"continueWithoutAnsweringButton": "Continue Without Answering", | ||
"answerQuestionButton": "Answer the Question", | ||
"correctButton": "Correct", | ||
"incorrectButton": "Incorrect", | ||
"submitButton": "Submit", | ||
"cancelButton": "Cancel", | ||
|
||
"yes": "Yes", | ||
"no": "No", | ||
"preferNotToAnswer": "Prefer not to answer", | ||
|
||
"yesNo": "(1) Yes (0) No", | ||
"yesNoPrefer": "(1) Yes (0) No (99) Prefer not to answer", | ||
|
||
"chooseState": "Choose a State", | ||
|
||
"basePrompt": " There {0} {1} question{2} unanswered on this page.", | ||
"softPrompt": " Would you like to continue?", | ||
"hardPrompt": " Please answer the question{0}.", | ||
|
||
"validationInputEmptyField": "Please fill out this field", | ||
"validationNumberGreaterThan": "Value must be greater than or equal to {0}", | ||
"validationNumberLessThan": "Value must be less than or equal to {0}", | ||
"validationMonthFormat": "Format should match YYYY-MM", | ||
"validationMonthInvalid": "Invalid month or year", | ||
"validationMonthAfter": "Date must be after {0}-{1}", | ||
"validationMonthBefore": "Date must be before {0}-{1}", | ||
"validationDateAfter": "Date must be after {0}/{1}/{2}", | ||
"validationDateBefore": "Date must be before {0}/{1}/{2}", | ||
"validationEmailAddress": "Please enter an email address in this format: [email protected]", | ||
"validationPhoneNumber": "Please enter a phone number in this format: 999-999-9999", | ||
"validationSocialFull": "Please enter a valid Social Security Number in this format: 999-99-9999", | ||
"validationSocialPartial": "Please enter the last four digits of a Social Security Number in this format: 9999", | ||
"validationTextShortExact": "Entered text is too short (should have {0} characters)", | ||
"validationTextLongExact": "Entered text is too long (should have {0} characters)", | ||
"validationTextShort": "Entered text is too short (should have at least {0} characters)", | ||
"validationTextLong": "Entered text is too long (should have at most {0} characters)", | ||
"validationMismatch": "Values do not match", | ||
"validationCountMore": "You have selected {0} items. Please select at least {1}", | ||
"validationCountLess": "You have selected {0} items. Please select no more than {1}", | ||
|
||
"months": ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], | ||
|
||
"example": "Example", | ||
"enterValue": "Enter a value" | ||
} | ||
|
||
export default en; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
const es = { | ||
"language": "es", | ||
|
||
"backButton": "Atrás", | ||
"resetAnswerButton": "Restablecer Respuesta", | ||
"submitSurveyButton": "Enviar Encuesta", | ||
"nextButton": "Siguiente", | ||
"responseRequestedLabel": "Respuesta Solicitada", | ||
"responseRequiredLabel": "Respuesta Requerida", | ||
"responseErrorLabel": "Respuesta Solicitada", | ||
"responseErrorBody": "Hay un error en esta respuesta. ¿Es correcta?", | ||
"submitLabel": "Enviar Respuestas", | ||
"submitBody": "¿Está seguro de que desea enviar sus respuestas?", | ||
"continueWithoutAnsweringButton": "Continuar Sin Responder", | ||
"answerQuestionButton": "Responder La Pregunta", | ||
"correctButton": "Correcto", | ||
"incorrectButton": "Incorrecto", | ||
"submitButton": "Enviar", | ||
"cancelButton": "Cancelar", | ||
|
||
"yes": "Sí", | ||
"no": "No", | ||
"preferNotToAnswer": "Prefiero no responder", | ||
|
||
"yesNo": "(1) Sí (0) No", | ||
"yesNoPrefer": "(1) Sí (0) No (99) Prefiero no responder", | ||
|
||
"chooseState": "Elija un Estado", | ||
|
||
"basePrompt": " Hay {1} pregunta{2} sin responder en esta página.", | ||
"softPrompt": " ¿Desea continuar?", | ||
"hardPrompt": " Responda las pregunta{0}.", | ||
|
||
"validationInputEmptyField": "Sírvase completar este campo", | ||
"validationNumberGreaterThan": "El valor debe ser mayor o igual a {0}", | ||
"validationNumberLessThan": "El valor debe ser menor o igual a {0}", | ||
"validationMonthFormat": "Debe tener el formato AAAA-MM", | ||
"validationMonthInvalid": "Mes o año no válido", | ||
"validationMonthAfter": "La fecha debe ser posterior al {0}-{1}", | ||
"validationMonthBefore": "La fecha debe ser anterior al {0}-{1}", | ||
"validationDateAfter": "La fecha debe ser posterior al {0}/{1}/{2}", | ||
"validationDateBefore": "La fecha debe ser anterior al {0}/{1}/{2}", | ||
"validationEmailAddress": "Ingrese una dirección de correo electrónico con este formato: [email protected]", | ||
"validationPhoneNumber": "Ingrese un número de teléfono con este formato: 999-999-9999", | ||
"validationSocialFull": "Ingrese un número de Seguro Social válido con este formato: 999-99-9999", | ||
"validationSocialPartial": "Ingrese los últimos cuatro dígitos de un número de Seguro Social con este formato: 9999", | ||
"validationTextShortExact": "El texto ingresado es demasiado corto (debe tener {0} caracteres)", | ||
"validationTextLongExact": "El texto ingresado es demasiado largo (debe tener {0} caracteres)", | ||
"validationTextShort": "El texto ingresado es demasiado corto (debe tener al menos {0} caracteres)", | ||
"validationTextLong": "El texto ingresado es demasiado largo (debe tener como máximo {0} caracteres)", | ||
"validationMismatch": "Los valores no coinciden", | ||
"validationCountMore": "Ha seleccionado {0} elementos. Seleccione al menos {1}", | ||
"validationCountLess": "Ha seleccionado {0} elementos. Seleccione no más de {1}", | ||
|
||
"months": ["Ene", "Feb", "Mar", "Abr", "Mayo", "Jun", "Jul", "Ago", "Sep", "Oct", "Nov", "Dic"], | ||
|
||
"example": "Ejemplo", | ||
"enterValue": "Introduzca un valor" | ||
} | ||
|
||
export default es; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.