Get translation file list from format, not from the system
offlate/formats/androidstrings.py
| 77 | 77 | ||
| 78 | 78 | def reload(self): | |
| 79 | 79 | self.translation = androidstringslib.android(self.conf["template"], self.conf["file"]) | |
| 80 | + | ||
| 81 | + | def translationFiles(self): | |
| 82 | + | return [self.translationfilename] |
offlate/formats/appstore.py
| 80 | 80 | trval = open(filename).read() | |
| 81 | 81 | resources.append(AppstoreEntry(filename, enval, trval)) | |
| 82 | 82 | self.resources = resources | |
| 83 | + | ||
| 84 | + | def translationFiles(self): | |
| 85 | + | return [x.filename for x in self.resources] |
offlate/formats/gettext.py
| 66 | 66 | self.po = polib.pofile(self.conf["file"]) | |
| 67 | 67 | else: | |
| 68 | 68 | self.po = polib.pofile(self.conf["pot"]) | |
| 69 | + | ||
| 70 | + | def translationFiles(self): | |
| 71 | + | return [self.conf["file"]] |
offlate/formats/ts.py
| 311 | 311 | def reload(self): | |
| 312 | 312 | self.tscontent = self.parse(self.tsfilename) | |
| 313 | 313 | self.savedcontent = [TSEntry(x) for x in self.tscontent] | |
| 314 | + | ||
| 315 | + | def translationFiles(self): | |
| 316 | + | return [self.tsfilename] |
offlate/formats/yaml.py
| 104 | 104 | lang1 = list(source.keys())[0] | |
| 105 | 105 | lang2 = list(dest.keys())[0] | |
| 106 | 106 | self.contents = yaml_rec_load([lang2], source[lang1], dest[lang2]) | |
| 107 | + | ||
| 108 | + | def translationFiles(self): | |
| 109 | + | return [self.dest] |
offlate/systems/github.py
| 55 | 55 | interface.githubBranchError('translation') | |
| 56 | 56 | return | |
| 57 | 57 | ||
| 58 | + | translationfiles = [] | |
| 58 | 59 | for mfile in self.translationfiles: | |
| 59 | - | mfile = mfile['filename'] | |
| 60 | + | translationfiles.extend(mfile['format'].translationFiles()) | |
| 61 | + | ||
| 62 | + | for mfile in translationfiles: | |
| 63 | + | mfile = mfile[len(self.basedir + '/current/'):] | |
| 60 | 64 | try: | |
| 61 | 65 | # workaround a bug, where we cannot get the content hash of a single file, by looking | |
| 62 | 66 | # for every file in the parent directory. |
offlate/systems/gitlab.py
| 51 | 51 | try: | |
| 52 | 52 | project = gl.projects.get(currentUser + "/" + projectname) | |
| 53 | 53 | except: | |
| 54 | - | project = project.forks.create({}) | |
| 54 | + | project = originproject.forks.create({}) | |
| 55 | 55 | ||
| 56 | 56 | try: | |
| 57 | 57 | branch = project.branches.create({'branch': 'translation', 'ref': self.branch}) | |
… | |||
| 59 | 59 | interface.gitlabTokenBranchError('translation') | |
| 60 | 60 | return | |
| 61 | 61 | actions = [] | |
| 62 | + | translationfiles = [] | |
| 62 | 63 | for mfile in self.translationfiles: | |
| 63 | - | mfile = mfile['filename'] | |
| 64 | + | translationfiles.extend(mfile['format'].translationFiles()) | |
| 65 | + | ||
| 66 | + | for mfile in translationfiles: | |
| 67 | + | mfile = mfile[len(self.basedir + '/current/'):] | |
| 64 | 68 | try: | |
| 65 | 69 | project.files.get(file_path=mfile, ref=self.branch) | |
| 66 | 70 | actions.append({'action': 'update', | |