Created
July 15, 2021 11:45
-
-
Save leegilmorecode/63309be0a4444b7a9ed92c0df368c154 to your computer and use it in GitHub Desktop.
Basic example function which returns the correct config values 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 getErrorTypes(locale = "uk") { | |
const errorTypes = { | |
uk: { | |
noDataErrorType: "NoData", | |
accessDeniedErrorType: "AccessDenied", | |
invalidValueErrorType: "InvalidValue", | |
}, | |
fr: { | |
noDataErrorType: "PasDeDonnées", | |
accessDeniedErrorType: "AccèsRefusé", | |
invalidValueErrorType: "ValeurInvalide", | |
}, | |
}; | |
return errorTypes[locale]; | |
} | |
module.exports = { getErrorTypes }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment