New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support DDTP translations #16
Conversation
You have to convert them all when using `format', but passing "%s" as a parameter works around that. We need one because `downloadIfNecessary' uses it to add the extension.
| if (match.empty) | ||
| continue; | ||
|
|
||
| if (!ret.data.canFind (match[1])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no builtin set type, but that's what I really want here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Jup, I know and it's annoying - but you can use an associative array instead of a set.
See https://github.com/ximion/appstream-generator/blob/master/source/engine.d#L567 for an example.
(actually, we could make our own set type with this)
| * | ||
| * Returns: The data if successful. | ||
| */ | ||
| string[] getFile (const string path, const uint retryCount = 5) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably rather be getFileContent because getFile makes me think I get a File or a filename back.
Here's what we do here (requires libas master and my PR ximion/appstream#64 or an equivalent fix):
File). One for returning astring[], and the other for downloading to a given location on the filesystem.InReleaseand find all translations referenced in there (TODO: verify hashes - use libapt or something).DebPackage.Component. For this we need to turn off libas's fallback which always returns theCtranslations when a language isn't translated - that's the bit that requires libas master.Style tips and other feedback appreciated.