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, Mar 29, 5:12 PM
Unknown Object (File)
Fri, Mar 29, 4:54 PM
Unknown Object (File)
Mar 15 2024, 3:02 PM
Unknown Object (File)
Feb 16 2024, 11:06 PM
Unknown Object (File)
Feb 5 2024, 7:52 AM
Unknown Object (File)
Feb 4 2024, 3:59 AM
Unknown Object (File)
Dec 28 2023, 5:47 PM
Unknown Object (File)
Dec 27 2023, 1:59 PM
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.