SFDigitalServices / formio-sfds

The form.io theme for sf.gov
https://formio-sfds.herokuapp.com/
MIT License
15 stars 2 forks source link

Map Drupal language codes internally #213

Closed shawnbot closed 2 years ago

shawnbot commented 2 years ago

This adds a new inputLanguageMap object that allows us to map the zh-hant language code from Drupal to the less specific zh internally (and from fil to tl).

github-actions[bot] commented 2 years ago

Size Change: +194 B (0%)

Total Size: 89.5 kB

Filename Size Change
dist/formio-sfds.standalone.js 68.9 kB +194 B (0%)
ℹ️ View Unchanged | Filename | Size | | :--- | :---: | | `dist/formio-sfds.css` | 14 kB | | `dist/portal.js` | 6.65 kB |

compressed-size-action

shawnbot commented 2 years ago

@JimBrodbeck the test URL for 1b3e8e6 seems to work for me:

https://sf.gov/zh-hant/xxxx-xxx-xxxx-xxx-xxxx-xx-xx-x-xxxxxxxx-xxxxxxxxx/form?formio-sfdsVersion=0.0.0-1b3e8e6

shawnbot commented 2 years ago

Not sure if I understand all of this but it mostly looks good. Not familiar with the ? syntax on line 106 but assume that's working/intentional.

Ah yes! ?. (and ?[foo]) is the new-ish optional chaining operator that effectively short-circuits the expression if the preceding value isn't accessible.