babel icon indicating copy to clipboard operation
babel copied to clipboard

How to pass separator for language/territory in CLI ?

Open x0139 opened this issue 6 years ago • 3 comments

Hello! How can i pass the separator for update and compile commands in cli-mode?

By default language and territory separated by "_", but i need the "-" symbol.

x0139 avatar Jan 10 '20 13:01 x0139

Can you explain your use case a little more?

akx avatar Jan 12 '20 21:01 akx

i have a locale folders like: en en-in en-nz

But pybabel want it like this: en en_in en_nz

I can not change folder names, cause it may broke the app.

And when i try to update or compile, for example: $ pybabel compile -f -d ./locale)

got exception this exciption:

...
  File "/Users/x0139/workspace/env/lib/python3.7/site-packages/babel/core.py", line 1094, in parse_locale
    raise ValueError('expected only letters, got %r' % lang)
ValueError: expected only letters, got 'en-in'

x0139 avatar Jan 13 '20 07:01 x0139

I also ran into this exact issue.

The translation management platform my team uses exports locale folders with - as separators.

justinttl avatar Jul 13 '22 17:07 justinttl