Created
January 23, 2019 10:59
-
-
Save lucasdu4rte/3e17eb8183e224c7420ff6b61318f6c8 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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