Skip to content

Instantly share code, notes, and snippets.

@fulopdaniel
Created August 10, 2018 16:18
Show Gist options
  • Save fulopdaniel/50b8e17c14204f486680be53a960aabc to your computer and use it in GitHub Desktop.
Save fulopdaniel/50b8e17c14204f486680be53a960aabc to your computer and use it in GitHub Desktop.
import axios from 'axios';
import messagesEn from './src/translations/temp/en.json'; // Import the extracted tokens
const messageKeys = [];
const API_URL = "YOUR API URL HERE";
Object.keys(messagesEn).forEach((message) => {
messageKeys.push(message); // I only send the tokens, not the default messages
});
axios.post(API_URL, messageKeys).then((res) => {
console.log(res);
}).catch((err) => {
console.log(err);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment