Skip to content

feat: Add language parameter to add_parcel service#72

Open
robbybarnes wants to merge 2 commits intojmdevita:mainfrom
robbybarnes:feature/add-language-parameter
Open

feat: Add language parameter to add_parcel service#72
robbybarnes wants to merge 2 commits intojmdevita:mainfrom
robbybarnes:feature/add-language-parameter

Conversation

@robbybarnes
Copy link

Summary

Adds support for the language parameter when adding new parcels via the add_parcel service. This allows users to specify their preferred language for tracking updates.

Motivation

The ParcelApp API supports a language parameter 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

  • Added LANGUAGE and DEFAULT_LANGUAGE constants to const.py
  • Updated ADD_PARCEL_SCHEMA in services.py to accept optional language parameter
  • Modified async_add_parcel to include language in API payload
  • Added field description in services.yaml
  • Added translation strings in translations/en.json

Usage

service: parcelapp.add_parcel
data:
  parcel_name: "My Package"
  tracking_number: "1234567890"
  courier: "fedex"
  language: "de"  # Optional, defaults to "en"

Testing

  • All existing tests pass (11/11)
  • Manually verified schema validation accepts the new parameter

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>
@PineappleEmperor
Copy link
Collaborator

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.

Copy link
Collaborator

@PineappleEmperor PineappleEmperor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
@jmdevita
Copy link
Owner

LGTM if @PineappleEmperor agrees!

@PineappleEmperor
Copy link
Collaborator

Happy to go ahead :) Do we want to hold off releasing a new version until a few more of these are done and merged?

@jmdevita
Copy link
Owner

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants