Created
July 15, 2021 11:44
-
-
Save leegilmorecode/21166b83a5a7a315968cc335d663c674 to your computer and use it in GitHub Desktop.
Basic JS function to return the write config based on locale
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
function getErrorMessages(locale = "uk") { | |
const errorMessages = { | |
uk: { | |
noDataErrorMessage: "No data", | |
accessDeniedErrorMessage: "Access denied", | |
invalidValueErrorMessage: "The value {0} is invalid", | |
}, | |
fr: { | |
noDataErrorMessage: "Pas de données", | |
accessDeniedErrorMessage: "Accès refusé", | |
invalidValueErrorMessage: "La valeur {0} est invalide", | |
}, | |
}; | |
return errorMessages[locale]; | |
} | |
module.exports = { getErrorMessages }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment