panoply/vscode-liquid

Translate filter autocompletions

davidwarrington opened this issue · 2 comments

I may have raised it privately before, but it would be cool if on adding the t filter it would automatically populate tabstops for variables in that translation. For example if in my locales I have:

{
  "pagination": {
    "page_current_of_total": "Page {{ current }} of {{ total }}"
  }
}

When rendering the t/translate filter through intellisense it would render this, and there'd be tab stops for the variables

{{ 'pagination.page_current_of_total' | t: current: , total: }} 

Alternatively, after adding the colon after t if it automatically suggested variables parsed from the locale that would be cool

Still needs some work as only supporting single translation variable. I'll finish the rest tomorrow brother! I've updated the nightly. Report back if you find anything drastic and I'll patch when finalising and supporting multiple argument arguments.

This also includes the automatic | t insertion logic. Sorry it took me so long to apply.

Screen.Recording.2023-08-04.at.02.10.19.mov

🚢 in the nightly VSIX - Enjoy:

Screen.Recording.2023-08-16.at.07.22.48.mov