Page MenuHomePhabricator

Add a "translate mode" to libphutil
AbandonedPublic

Authored by epriestley on Jun 8 2014, 2:12 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Dec 10, 8:37 PM
Unknown Object (File)
Thu, Dec 5, 8:44 PM
Unknown Object (File)
Thu, Dec 5, 7:40 PM
Unknown Object (File)
Sat, Nov 30, 7:42 AM
Unknown Object (File)
Tue, Nov 26, 2:04 PM
Unknown Object (File)
Sun, Nov 24, 4:45 PM
Unknown Object (File)
Sun, Nov 24, 12:15 AM
Unknown Object (File)
Thu, Nov 21, 5:46 AM
Subscribers

Details

Reviewers
btrahan
chad
Maniphest Tasks
T5267: Localize Phabricator
Summary

Ref T5267. Speculative, but here's the first step in maybe building stronger first-party tools. The next diff will demo this better.

Basically:

  • When we're in translation mode, return a string-like object instead of a real string.
  • Contexts that use it as a string usually just work, or we may need to add a few (string) casts.
  • Contexts that use it as HTML get a tag instead. This is translatable in the UI.
  • We keep track if we rendered it into a string or not so we can build a menu of "other strings on this page" for things like title, options in dropdowns, etc.
Test Plan

See next diff

Diff Detail

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

Event Timeline

epriestley retitled this revision from to Add a "translate mode" to libphutil.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added reviewers: btrahan, chad.
chad edited edge metadata.

Not sure if you actually wanted to land these diffs or have Bob look at it first.

This revision is now accepted and ready to land.Jun 10 2014, 8:49 PM

I'm not going to move them forward for now. Big takeaway for me is just that we can realistically do this if we want to.