Skip to content

Instantly share code, notes, and snippets.

@leegilmorecode
Created July 15, 2021 11:45
Show Gist options
  • Save leegilmorecode/63309be0a4444b7a9ed92c0df368c154 to your computer and use it in GitHub Desktop.
Save leegilmorecode/63309be0a4444b7a9ed92c0df368c154 to your computer and use it in GitHub Desktop.
Basic example function which returns the correct config values based on locale
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