Skip to content
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

Only retrieve DDTP translations from the section we're looking at #17

Merged
merged 1 commit into from Aug 24, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -65,17 +65,17 @@ public:

private immutable(string[]) findTranslations (const string suite, const string section)
{
import std.regex : ctRegex, matchFirst;
import std.regex : matchFirst, regex;

immutable inRelease = buildPath (rootDir, "dists", suite, "InRelease");
auto regex = ctRegex!(r"Translation-(\w+)$");
auto translationregex = r"%s/i18n/Translation-(\w+)$".format (section).regex;
bool[string] ret;

try {
const inReleaseContents = getFileContents (inRelease);

foreach (const ref entry; inReleaseContents) {
auto match = entry.matchFirst(regex);
auto match = entry.matchFirst (translationregex);

if (match.empty)
continue;
@@ -110,8 +110,8 @@ public:
try {
fname = downloadIfNecessary (rootDir, tmpDir, fullPath);
} catch (Exception ex) {
logDebug ("No long descriptions for %s/%s", suite, section);
return;
logDebug ("No translations for %s in %s/%s", lang, suite, section);
continue;
}

auto tagf = new TagFile ();