@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

i18n extractor: produce intersection of types, remove warning

Summary:
Ref T16378

This warning isn't useful. It's a known fact that the Phorge codebase contains examples of strings whose types vary across callsites, and they're not easy to fix, so there's nothing to do on recieving that warning. Instead only output a number if all callsites are a number (or in theory only output a person if all callsites are a person)

Test Plan: Run i18n extractor, compare output, don't see warnings.

Reviewers: O1 Blessed Committers, aklapper

Reviewed By: O1 Blessed Committers, aklapper

Subscribers: aklapper, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T16378

Differential Revision: https://we.phorge.it/D26624

Pppery b3bb110c 937fc1ca

+9 -8
+9 -8
src/infrastructure/internationalization/management/PhabricatorInternationalizationManagementExtractWorkflow.php
··· 187 187 'line' => $string_info['line'], 188 188 ); 189 189 190 + $stypes = $string_info['types']; 190 191 if (!isset($map[$string]['types'])) { 191 - $map[$string]['types'] = $string_info['types']; 192 - } else if ($map[$string]['types'] !== $string_info['types']) { 193 - echo tsprintf( 194 - "**<bg:yellow> %s </bg>** %s\n", 195 - pht('WARNING'), 196 - pht( 197 - 'Inferred types for string "%s" vary across callsites.', 198 - $string_info['string'])); 192 + $map[$string]['types'] = $stypes; 193 + } else if ($map[$string]['types'] !== $stypes) { 194 + foreach ($map[$string]['types'] as $i => $t) { 195 + if ($t !== $stypes[$i]) { 196 + // This type is not consistent, set it to null since we don't know 197 + $map[$string]['types'][$i] = null; 198 + } 199 + } 199 200 } 200 201 } 201 202 }