feat: Add language parameter to add_parcel service#72
feat: Add language parameter to add_parcel service#72robbybarnes wants to merge 2 commits intojmdevita:mainfrom
Conversation
Adds optional language parameter to the add_parcel service, allowing users to specify the language for delivery information (ISO 639-1 two-letter code). This addresses issue jmdevita#70 and aligns with the Parcel App API which supports an optional 'language' parameter for the add-delivery endpoint. Changes: - Added LANGUAGE and DEFAULT_LANGUAGE constants to const.py - Updated ADD_PARCEL_SCHEMA to include optional language field - Modified async_add_parcel to include language in API payload - Added language field to services.yaml - Added translation strings for language field Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Hey @robbybarnes! Thanks very much for all the PRs, I'm working my way through them and will leave some review comments as I go. This one seems to be fairly straight-forward, though I haven't been able to properly test the language feature; from what I can see it's passed correctly as per the API docs at least! The only comment I have on this one is I feel the UX is better if the notificaiton option in the service is last, after the language option. |
PineappleEmperor
left a comment
There was a problem hiding this comment.
If you can rearrange the services.yaml I think it's good to go! 🚀
Move language field before send_push_confirmation for better UX as requested in PR review. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
LGTM if @PineappleEmperor agrees! |
|
Happy to go ahead :) Do we want to hold off releasing a new version until a few more of these are done and merged? |
|
I'm thinking we package a few of these together so that they all merge into a new release, I'll be taking a look in the next few days as well! |
Summary
Adds support for the
languageparameter when adding new parcels via theadd_parcelservice. This allows users to specify their preferred language for tracking updates.Motivation
The ParcelApp API supports a
languageparameter in the/external/add-delivery/endpoint (see API docs), but this integration wasn't exposing it. Users in non-English speaking regions may want tracking updates in their native language.Changes
LANGUAGEandDEFAULT_LANGUAGEconstants toconst.pyADD_PARCEL_SCHEMAinservices.pyto accept optionallanguageparameterasync_add_parcelto include language in API payloadservices.yamltranslations/en.jsonUsage
Testing