use new metadata locations for fdroid

This commit is contained in:
tobiaskaminsky 2017-11-13 09:42:21 +01:00 committed by tobiasKaminsky
parent 1b200a5bad
commit 2b793f3bb2
No known key found for this signature in database
GPG key ID: 0E00D4D47D0C5AF7
7 changed files with 20 additions and 12 deletions

View file

@ -1 +0,0 @@
Nextcloud

View file

@ -1 +0,0 @@
Nextcloud

View file

@ -1 +0,0 @@
Nextcloud

View file

@ -1 +0,0 @@
Nextcloud

View file

@ -12,7 +12,8 @@ from xml.etree import ElementTree
XML_PATH = '../../src/main/res' XML_PATH = '../../src/main/res'
METADATA_PATH = '../../fastlane/metadata/android' METADATA_PATH = '../../src/generic/fastlane/metadata/android/'
METADATA_DEV_PATH = '../../src/versionDev/fastlane/metadata/android/'
DEFAULT_LANG = 'en-US' DEFAULT_LANG = 'en-US'
LANG_MAP = { LANG_MAP = {
'values': 'en-US', 'values': 'en-US',
@ -79,15 +80,24 @@ def main():
e = ElementTree.parse(strings_file).getroot() e = ElementTree.parse(strings_file).getroot()
short_desc = e.find('.//string[@name="store_short_desc"]') short_desc = e.find('.//string[@name="store_short_desc"]')
full_desc = e.find('.//string[@name="store_full_desc"]') full_desc = e.find('.//string[@name="store_full_desc"]')
if short_desc is None or full_desc is None: short_dev_desc = e.find('.//string[@name="store_short_dev_desc"]')
print("Warning: Skipping %s because of incomplete translation" % entry) full_dev_desc = e.find('.//string[@name="store_full_dev_desc"]')
continue if short_desc is not None:
save_file(short_desc.text, LANG_MAP[entry], 'short_description.txt') save_file(short_desc.text, LANG_MAP[entry], 'short_description.txt', False)
save_file(full_desc.text, LANG_MAP[entry], 'full_description.txt') if short_dev_desc is not None:
save_file(short_dev_desc.text, LANG_MAP[entry], 'short_description.txt', True)
if full_desc is not None:
save_file(full_desc.text, LANG_MAP[entry], 'full_description.txt', False)
if full_dev_desc is not None:
save_file(full_dev_desc.text, LANG_MAP[entry], 'full_description.txt', True)
def save_file(text, directory, filename): def save_file(text, directory, filename, dev):
directory_path = os.path.join(PATH, METADATA_PATH, directory) if dev:
directory_path = os.path.join(PATH, METADATA_DEV_PATH, directory)
else:
directory_path = os.path.join(PATH, METADATA_PATH, directory)
if not os.path.exists(directory_path): if not os.path.exists(directory_path):
os.makedirs(directory_path) os.makedirs(directory_path)
if filename == 'short_description.txt': if filename == 'short_description.txt':

View file

@ -0,0 +1 @@
Nextcloud

View file

@ -0,0 +1 @@
Nextcloud Dev