Skip to content
This repository has been archived by the owner on Oct 24, 2018. It is now read-only.

Support missing po files [Originates from frontend-experiments branch] #7

Closed
wants to merge 2 commits into from

Conversation

jatindhankhar
Copy link
Owner

This enables build process to continue in case of po files are missing.
This is done in two parts
First we add fallback values in the model itself

We change MANDATORY_ATTRIBUTES and remove categories and summary and retain following

MANDATORY_ATTRIBUTES = ['name', 'bundle_id', 'license',
                                'icon', 'activity_version']

License is necessary and recent analysis shows that very few repos are without license and to avoid any legal problems, aslo should clearly depict license of the activity (whatever is decided by the author)

summary = me.DictField(required=True,default={'en' : "Unknown Summary"})
categories = me.ListField(me.StringField(max_length=30),default=["unknown"])

Then we add default values for i18n in case translations are missing

 if any(translations):
       metadata['i18n_name'] = i18n.translate_field(metadata['name'],
                                                 translations)
       metadata['i18n_summary'] = i18n.translate_field(metadata['summary'],
                                                    translations)
    else:
        metadata['i18n_name'] = {'en' : metadata['name']}
        if 'summary' not in metadata:
            metadata['i18n_summary'] = {'en' : "No summary"}
        else:
             metadata['i18n_summary'] = {'en' : metadata['summary']} 

@jatindhankhar jatindhankhar changed the title Support missing po files Support missing po files [Originates from frontend-experiments branch] Jul 22, 2017
@scanterog
Copy link
Collaborator

Added some minor fixes and merged into master.

@scanterog scanterog closed this Jul 24, 2017
@scanterog scanterog deleted the support-nmissing-po-files branch July 24, 2017 19:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants