Closed shawnbot closed 3 years ago
This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.
🔍 Inspect: https://vercel.com/sfds/formio-sfds/brqgriemt
✅ Preview: https://formio-sfds-git-translate-view.sfds.vercel.app
Size Change: +271 B (0%)
Total Size: 92 kB
Filename | Size | Change | |
---|---|---|---|
dist/formio-sfds.standalone.js |
68 kB | +271 B (0%) |
This is a big update to the localization docs that adds a lot more detail describing the process for getting from form to Phrase and back again. The code changes support this process:
form.backTitle
string key is used to localize the "Back" text that shows up if you provideproperties.backURL
in your form.translate
form option short-circuits checks forwindow.drupalSettings
so that the in-context editor can be enabled on any page that loads a form with that option hard-coded./api/translate
endpoint renders a proxied sf.gov page with thetranslate: true
andunlockNavigation: true
form options set, which enables the in-context editor and allows navigation between form pages without validation./api/preview
,/api/strings
, and/api/translate
to URLs without the/api
prefix so that they're easier to remember.New view for translators
The new translation view lives at
/api/translate?url=<URL>
, where<URL>
is the URL of your published form on sf.gov (or test-sfgov). For instance, this is the translate view for the Cannabis social equity applicant questionnaire, once you've signed in with Phrase:There are a couple of important things going on here:
Some templates have additional output specific to the translation view:
Panel components (pages in a wizard form) display an additional "Link title" heading that allows you to translate the text of the link that shows up in the side navigation of the wizard view:
These translations live in the
{key}.displayTitle
string in Phrase, and are only shown if thedisplayTitle
custom property is set in the form.io editor.All components except panel and content types display the text of custom validation and error messages in red if they're not empty in the form.io editor.