Skip to content

Commit

Permalink
MDLSITE-7371 Exclude langconfig strings from stats
Browse files Browse the repository at this point in the history
Simply said, all langconfig strings are considered as translated
(defined or inherited) and never missing.
  • Loading branch information
mudrd8mz committed Nov 8, 2023
1 parent 05fd9ae commit 3575ef0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cli/utilslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -380,12 +380,18 @@ protected function rebuild_zip_package(mlang_version $version, $langcode) {
if ($langcode !== 'en') {
$english = mlang_component::from_snapshot($componentname, 'en', $version);
$component->intersect($english);
$numberofenglishstrings = $english->get_number_of_strings(true);
$english->clear();
}
$this->dump_component_into_temp($component);

if ($component->has_string()) {
$numberofstrings = $component->get_number_of_strings(true);
if ($langcode !== 'en' && $component->name === 'langconfig') {
$numberofstrings = $numberofenglishstrings;
} else {
$numberofstrings = $component->get_number_of_strings(true);
}

$this->statsman->add_to_buffer($component->version->code, $component->lang, $component->name, $numberofstrings);
}

Expand Down

0 comments on commit 3575ef0

Please sign in to comment.