import translations from './ru.json'

export default function Translate(template, replacements) {
  replacements = replacements || {}

  template = translations[template] || template

  return template.replace(/\{([^}]+)\}/g, (_, key) => {
    return replacements[key] || `{${key}}`
  })
}
