Page MenuHomePhabricator

Allow PhutilTranslator::translate() to return defaults
ClosedPublic

Authored by Zolli on Jan 1 2015, 11:32 AM.
Referenced Files
Unknown Object (File)
Tue, May 7, 5:41 AM
Unknown Object (File)
Fri, May 3, 3:27 AM
Unknown Object (File)
Mon, Apr 29, 2:59 PM
Unknown Object (File)
Fri, Apr 26, 4:35 PM
Unknown Object (File)
Fri, Apr 26, 4:35 PM
Unknown Object (File)
Fri, Apr 26, 4:35 PM
Unknown Object (File)
Fri, Apr 26, 4:35 PM
Unknown Object (File)
Fri, Apr 26, 4:35 PM

Details

Summary

Allow PhutilTranslator::translate() to return defaults

Test Plan

Just check some strings returned correctly.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Zolli retitled this revision from to Allow PhutilTranslator::translate() to return defaults.
Zolli updated this object.
Zolli edited the test plan for this revision. (Show Details)
Zolli added a reviewer: Blessed Reviewers.
Zolli set the repository for this revision to rPHU libphutil.
Zolli added a project: Localization.
Zolli added a subscriber: Zolli.
Zolli edited edge metadata.

Works properly with HTMLoutput

epriestley added a reviewer: epriestley.

This behaves incorrectly for the translation "0", and I think this filtering should just occur in the translation provider itself. See T6845.

This revision now requires changes to proceed.Jan 1 2015, 2:29 PM
Zolli edited edge metadata.

Reworked this a bit. This method allows to make translation backword compatible and only filter keys with NULL value. The clean() would be overwritten from translation class to define own cleaner function.

This comment was removed by Zolli.
Zolli edited edge metadata.
  • Fixed linting issue
epriestley edited edge metadata.

Some minor inlines, I'll just fix these in the pull. Thanks!

src/infrastructure/internationalization/translation/PhabricatorTranslation.php
10

"cleand" -> "cleaned"

For consistency, use full sentences with periods in documentation:

- Return the cleand translation array
+ Return the cleaned translation array.
                  ^                   ^
14

For consistency with getTranslations(), let's call this getCleanTranslations() (i.e., "translations", not "translation").

25

Use an array typehint, since this parameter must always be an array.

28–32

Braces aren't aligned.

This revision is now accepted and ready to land.Jan 1 2015, 4:13 PM
This revision was automatically updated to reflect the committed changes.