Fix #109: connect --language and --country to export request options - #449
Open
jacalata wants to merge 1 commit into
Open
Fix #109: connect --language and --country to export request options#449jacalata wants to merge 1 commit into
jacalata wants to merge 1 commit into
Conversation
--language was already threading through to request_options.language on export, but --country never reached the REST API. tabcmd Classic combined the two into a BCP 47 locale like en-GB or de-DE so exports formatted numbers, dates, and currency for that region. - Add _resolve_locale() that joins language + country when both are set, falls back to language alone, and drops country-only (matching Classic which required --language with --country). - Route apply_png_options / apply_pdf_options / apply_csv_options through the helper. - Relax --country choices from language codes to any 2-letter code (upper-cased), so users can pass real country codes like GB, MX, BR. Fixes #109.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--languagewas already threading through torequest_options.languageon export, but--countrynever reached the REST API. tabcmd Classic combined the two into a BCP 47 locale (e.g.en-GB,de-DE,pt-BR) so exports formatted numbers, dates, and currency for that region._resolve_locale()that joins language + country when both are set, falls back to language alone, and drops country-only (matching Classic which required--languagewith--country).apply_png_options/apply_pdf_options/apply_csv_optionsthrough the helper.--countrychoices from language codes (de|en|es|fr|it|...) to any 2-letter code (upper-cased), so users can actually pass country codes likeGB,MX,BR.Closes #109.
Test plan
tests/commands/test_datasources_and_workbooks_command.py— 6 new tests cover combined locale for PNG/PDF/CSV, country-only drop, language-only pass-throughtest_datasources_and_workbooks_command.pysuite: 30 passed🤖 Generated with Claude Code