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)
Fri, Oct 11, 6:33 PM
Unknown Object (File)
Wed, Oct 2, 1:30 PM
Unknown Object (File)
Aug 27 2024, 11:41 AM
Unknown Object (File)
Aug 20 2024, 10:26 PM
Unknown Object (File)
Aug 20 2024, 10:51 AM
Unknown Object (File)
Aug 16 2024, 5:59 AM
Unknown Object (File)
Aug 8 2024, 7:19 AM
Unknown Object (File)
Aug 6 2024, 5:44 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.