Page MenuHomePhabricator

When a translated string is bogus, partially recover
ClosedPublic

Authored by epriestley on Jan 2 2015, 9:35 PM.
Tags
None
Referenced Files
F13214677: D11160.id26780.diff
Fri, May 17, 12:21 PM
F13198838: D11160.diff
Mon, May 13, 10:09 AM
F13181355: D11160.diff
Thu, May 9, 11:52 AM
Unknown Object (File)
Sat, Apr 27, 11:47 AM
Unknown Object (File)
Sat, Apr 27, 6:26 AM
Unknown Object (File)
Thu, Apr 25, 11:33 PM
Unknown Object (File)
Thu, Apr 25, 11:33 PM
Unknown Object (File)
Mon, Apr 22, 6:30 PM
Subscribers

Details

Summary

Hit one of these; this makes it easier to figure out which string is problematic.

Test Plan

Saw UI render a string which I could more easily hunt down.

Diff Detail

Repository
rPHU libphutil
Branch
i18n2
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 3498
Build 3506: [Placeholder Plan] Wait for 30 Seconds

Event Timeline

epriestley retitled this revision from to When a translated string is bogus, partially recover.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added reviewers: btrahan, joshuaspence.
btrahan edited edge metadata.
This revision is now accepted and ready to land.Jan 2 2015, 9:38 PM
src/internationalization/PhutilTranslator.php
64

Isn't this basically what idx does?

src/internationalization/PhutilTranslator.php
64

Oh, sorry, this was dirty nonsense in my working copy. Thanks for catching that.

This was an alternate version of rP1984539: basically, if you have an extracted translation array like this:

array(

'apple' => null,

);

...that is, you haven't written any translations yet, then idx() will select the key and you'll get null.

An alternate version of this would be:

$translation = coalesce(idx($this->translations, $text), $text);

...but rP1984539 was a cleaner fix.

epriestley edited edge metadata.
  • Cleanup leftovers.