Skip to content

fix: preserve language_presets locale code keys from case conversion#65

Merged
PennyroyalTea merged 1 commit intoelevenlabs:mainfrom
donnyyung:fix/preserve-locale-code-keys-in-language-presets
Mar 12, 2026
Merged

fix: preserve language_presets locale code keys from case conversion#65
PennyroyalTea merged 1 commit intoelevenlabs:mainfrom
donnyyung:fix/preserve-locale-code-keys-in-language-presets

Conversation

@donnyyung
Copy link
Contributor

Problem: Ran into an issue where I was running elevenlabs agents pull, making some changes, and then running elevenlabs agents push. Because I had brazilian portuguese in the language presets, the initial pull looked like

        "language_presets": {
            "pt_br": {
                "overrides": {
                    "agent": {
                        "first_message": "Olá! Estou aqui para ajudá-lo a encontrar a ferramenta de software certa. O que você está tentando resolver?"
                    }
                },
                "first_message_translation": {
                    "source_hash": "{\"firstMessage\":\"Hi there! I'm here to help you find the right software tool. What are you solving for? \",\"language\":\"en\"}",
                    "text": "Olá! Estou aqui para ajudá-lo a encontrar a ferramenta de software certa. O que você está tentando resolver?"
                }
            },

And then on the push ran into an issue because pt_br became ptBr and I got this error from the api:

  "Value error, Preset languages must be one of en, zh, es, hi, pt, fr, de, ja, ar, ko,
  id, it, nl, tr, pl, ru, sv, tl, fil, ms, ro, uk, el, cs, da, fi, bg, hr, sk, ta, vi,
  no, hu, af, hy, as, az, be, bn, bs, ca, et, gl, ka, gu, ha, he, is, ga, jv, kn, kk,
  ky, lv, lt, lb, mk, ml, mr, ne, ps, fa, pa, sr, sd, sl, so, sw, te, th, ur, cy, pt-br
  but got ptBr"

I made this change on a local fork and it worked so wanted to contribute upstream.

Locale codes like "pt-br" under language_presets are user-defined
identifiers, not schema fields. Without this fix, they get incorrectly
converted (pt-br → ptBr / pt_br) during push/pull, breaking the API.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@PennyroyalTea
Copy link
Collaborator

lgtm, thanks for contribution!

@PennyroyalTea PennyroyalTea merged commit 3403151 into elevenlabs:main Mar 12, 2026
4 checks passed
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.

2 participants