Last active
May 21, 2018 09:57
-
-
Save DastanIqbal/deeb67f3b4f6fd8fe31732a5729b7937 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
import sys | |
separator = "=" | |
file = open(sys.argv[2],'w') | |
file.write('<?xml version="1.0" encoding="utf-8"?>\n') | |
file.write('<resources>\n') | |
with open(sys.argv[1]) as f: | |
for line in f: | |
if separator in line: | |
name, value = line.split(separator, 1) | |
file.write('<string name="'+name.lower()+'">'+value+'</string>\n') | |
file.write('</resources>') | |
file.close |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment