# en.js file
export default {
name_error: "Name is required",
};
# ur.js file
export default {
name_error : "نام مطلوب ہے",
}
- This python script reads key and values from 'en.js' .
- Then converted the strings to desired language using google translator api
result = Translation("en.js", "ur","en")
- The converted strings write in to 'ur.js' file
WritingTranslationToOtherFile("ur.js")
Too many requests to translator api will block your IP for one day (Google has a translate API that costs money to use so they want to stop free usage from other apis). Better to use in Jupyter Notebook or any or use VPN.
That's it. 😃😃