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
F19267351: D11160.id26786.diff
Mon, Dec 22, 8:40 PM
F19266930: D11160.id26785.diff
Mon, Dec 22, 8:26 PM
F19181979: D11160.id26785.diff
Tue, Dec 16, 3:22 AM
F19076637: D11160.id.diff
Mon, Dec 1, 12:39 PM
F19068957: D11160.diff
Sun, Nov 30, 12:48 PM
F18955993: D11160.diff
Nov 12 2025, 9:45 PM
F18849920: D11160.id.diff
Oct 30 2025, 1:09 PM
F18845524: D11160.diff
Oct 29 2025, 12:44 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
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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.