Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ttag spell fails #61

Open
dimaqq opened this issue Feb 13, 2019 · 6 comments
Open

ttag spell fails #61

dimaqq opened this issue Feb 13, 2019 · 6 comments
Labels

Comments

@dimaqq
Copy link
Contributor

dimaqq commented Feb 13, 2019

> yarn run ttag spell int/ja.po
yarn run v1.12.3
$ /xxx/node_modules/.bin/ttag spell int/ja.po
⠋ Loading dict for ja...(node:8291) UnhandledPromiseRejectionWarning: Incorrect or unsupported locale
(node:8291) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:8291) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
⠙ Loading dict for ja...

A few issues with this:

  • none of my locales seems supported
  • unhandled rejection
  • command appears to hang
@AlexMost
Copy link
Member

Thanks for the report!
Seems like a bug.
@vharitonsky

@AlexMost AlexMost added the bug label Feb 13, 2019
@cube-dan
Copy link

cube-dan commented Jul 3, 2019

I'm seeing the same issue. I've tried this with and without the [locale] argument:
image

In my case however I'm using ttag-cli, like this:
npx ttag spell src/i18n/es.po es
... or like this (without the locale arg):
npx ttag spell src/i18n/es.po

Either way I get back this error (full error at bottom of this post)
Loading dict for es...(node:52752) UnhandledPromiseRejectionWarning: Incorrect or unsupported locale

My .po file was created with npx ttag init following the locale naming guidelines here:
https://ttag.js.org/docs/quickstart.html#create-po-file
Additionally I'm using "es" which the "GNU Usual Language Codes" manual says is valid:
https://www.gnu.org/software/gettext/manual/html_node/Usual-Language-Codes.html

Thanks for the awesome lib guys ... everything else I've done with the lib has worked great!

-Dan

Full error text:

⠋ Loading dict for es...(node:52752) UnhandledPromiseRejectionWarning: Incorrect or unsupported locale
(node:52752) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:52752) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
⠇ Loading dict for es...

@tino
Copy link

tino commented Sep 16, 2019

Any updates on this? Workarounds?

@dimaqq
Copy link
Contributor Author

dimaqq commented Sep 19, 2019

I think @tino is asking repo owner to tag this issue help-wanted 😆

@NotSqrt
Copy link

NotSqrt commented Mar 28, 2022

Hello,
Allowed locales are hardcoded here : https://github.com/ttag-org/ttag-cli/blob/master/src/lib/spell.ts#L75 : only uk or ru or en

@dimaqq
Copy link
Contributor Author

dimaqq commented Mar 29, 2022

My 2c: instead of hardcoded locale list, I think it makes more sense to try and fetch the corresponding file from LibreOffice (which is what the code does for whitelisted locales now) and if that succeeds, use the dictionary; if that fails, then locale is not supported.
The minor caveat is that some dictionary folders are like bo and others like br_FR (with the geographical locale tag), so maybe some guessing is required... or perhaps that mapping alone can be specified in the ttag cli repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants