Skip to content

Instantly share code, notes, and snippets.

@lucasdu4rte
Created January 23, 2019 10:59
Show Gist options
  • Save lucasdu4rte/3e17eb8183e224c7420ff6b61318f6c8 to your computer and use it in GitHub Desktop.
Save lucasdu4rte/3e17eb8183e224c7420ff6b61318f6c8 to your computer and use it in GitHub Desktop.
const eng = {
above: 'The {{field}} should be above {{argument.0}}.',
accepted: 'The {{field}} should have been accepted',
after: 'The {{field}} should be a date after {{argument.0}}'
}
const pt = {
acima: 'O {{field}} deve estar acima de {{argument.0}}.',
aceito: 'O {{field}} deveria ter sido aceito',
after: 'O {{field}} deve ser uma data após {{argument.0}}'
}
var obj = {}
const engkeys = Object.keys(eng)
const ptvalues = Object.values(pt)
// alterar nome do propriedade do objeto acima => above
engkeys.map((key, index) => {
obj[key] = ptvalues[index]
})
console.log(JSON.stringify(obj))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment