Page MenuHomePhabricator

Allow PhutilTranslator::translate() to return defaults
ClosedPublic

Authored by Zolli on Jan 1 2015, 11:32 AM.
Referenced Files
F14009831: D11121.id.diff
Thu, Oct 31, 12:04 AM
F14008751: D11121.diff
Wed, Oct 30, 6:14 AM
F14008711: D11121.id26699.diff
Wed, Oct 30, 5:23 AM
F14001161: D11121.diff
Fri, Oct 25, 4:43 AM
F13993474: D11121.id26717.diff
Tue, Oct 22, 11:05 PM
F13983895: D11121.id26701.diff
Sun, Oct 20, 9:32 AM
F13971285: D11121.id26699.diff
Oct 17 2024, 12:39 PM
Unknown Object (File)
Oct 13 2024, 7:34 PM

Details

Summary

Allow PhutilTranslator::translate() to return defaults

Test Plan

Just check some strings returned correctly.

Diff Detail

Repository
rPHU libphutil
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 3460
Build 3467: [Placeholder Plan] Wait for 30 Seconds

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.