Skip to content

Commit

Permalink
add text configurable (release)
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaume-chervet committed Aug 2, 2023
1 parent d8d4f66 commit a9b8c53
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ Texts can be override by passing a translation object to the initAsync method.
const translations = {
'sc-modal-video__title' : 'Positionner 5 secondes votre document dans le cadre',
'sc-modal-video__invert-camera' : "Inverser caméra",
'sc-modal-video__message-too-dark' : "Image trop sombre",
'sc-modal-video__quit' : "X",
'sc-modal-confirm__loading' : "Traitement en cours...",
'sc-modal-confirm__title':"Es-ce que tous les champs sont parfaitement lisibles ?",
Expand Down
3 changes: 2 additions & 1 deletion src/SlightCapture/video.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ const loadOpenCVAsync = async (openCVScript = `https://docs.opencv.org/4.8.0/ope
const texts = {
'sc-modal-video__title' : 'Positionner 5 secondes votre document dans le cadre',
'sc-modal-video__invert-camera' : "Inverser caméra",
'sc-modal-video__message-too-dark' : "Image trop sombre",
'sc-modal-video__quit' : "X",
'sc-modal-confirm__loading' : "Traitement en cours...",
'sc-modal-confirm__title':"Est-ce que tous les champs sont parfaitement lisibles ?",
Expand Down Expand Up @@ -267,7 +268,7 @@ const captureAsync = (cv) => async (name,
const fontScale = 2;
const thickness = 10;
let colorRed = new cv.Scalar(200, 200, 0, 100);
cv.putText(imageOutput, "Image trop sombre", new cv.Point(Math.round(size.width + size.width * 0.1), Math.round(imageOutput.rows *0.12)), font, fontScale, colorRed, thickness, cv.LINE_AA);
cv.putText(imageOutput, translations['sc-modal-video__message-too-dark'], new cv.Point(Math.round(size.width + size.width * 0.1), Math.round(imageOutput.rows *0.12)), font, fontScale, colorRed, thickness, cv.LINE_AA);
}

if (counterTime > 5) {
Expand Down

0 comments on commit a9b8c53

Please sign in to comment.