Comments (17)
Hi,
The regex /utf-?8$/
covered both utf-8
and utf8
- Please use the git version here, since the PKGBUILD on AUR is a bit outdated.
from translate-shell.
I forgot to say that I used the version from the stable branch, not the one in the AUR.
from translate-shell.
I see what's going on here - Please check out the develop
branch. (the fix hasn't been merged into stable
branch yet.)
from translate-shell.
Doesn't fix this, because the file from the develop branch also checks for LC_CTYPE
which isn't set on any of my systems.
from translate-shell.
I can't reproduce this after unsetting my LC_CTYPE
. Can you report the output of these?
$ echo $LC_TYPE
$ echo $LANG
$ grep `which trans` -e 'ENVIRON\["LC_CTYPE"\]'
from translate-shell.
# $ echo $LC_TYPE
# $ echo $LANG
en_US.utf8
# $ grep ~/bin/trans -e 'ENVIRON\["LC_CTYPE"\]'
UserLang = ENVIRON["LC_CTYPE"] ?
parseLang(ENVIRON["LC_CTYPE"]) :
if (ENVIRON["LANG"] !~ /UTF-8$/ && ENVIRON["LC_CTYPE"] !~ /UTF-8$/)
from translate-shell.
# $ echo $LC_CTYPE
from translate-shell.
Obviously you have not updated your ~/bin/trans
. This line indicates that you're still using the outdated code:
if (ENVIRON["LANG"] !~ /UTF-8$/ && ENVIRON["LC_CTYPE"] !~ /UTF-8$/)
While the code in develop
branch should be:
if (tolower(ENVIRON["LANG"]) !~ /utf-?8$/ && tolower(ENVIRON["LC_CTYPE"]) !~ /utf-?8$/)
To use the one from develop
branch, run make build
(the executable script should be generated in your build/
)
from translate-shell.
translate-shell
is a submodule of my dotfiles repo and I had set the branch of the submodule to develop but the module was still at the stable
branch. Git submodules ... 🙈
Now it works.
from translate-shell.
I am using arch too, it has the same problem. I am using the develop branch of trans
.
# $ echo $LC_TYPE
# $ echo $LANG
en_GB.utf8
# $ grep -e 'ENVIRON\["LC_CTYPE"\]' $(which trans)
(ENVIRON["LC_CTYPE"] ? ENVIRON["LC_CTYPE"] :
from translate-shell.
@pickfire What's your problem? Command-line output? Version of trans
?
from translate-shell.
trans --version
[WARNING] Your locale codeset (C) is not UTF-8.
Translate Shell 0.9-dev
gawk (GNU Awk) 4.1.2
fribidi (GNU FriBidi) 0.19.6
User Language English (English)
trans 你好
[WARNING] Your locale codeset (C) is not UTF-8.
from translate-shell.
@pickfire Can you post the output of locale
?
It seems one of your locale variable is set to 'C
' (which often implies ASCII-only for most systems) and trans
doesn't like it.
from translate-shell.
locale
LANG=en_GB.UTF-8
LC_CTYPE="en_GB.UTF-8"
LC_NUMERIC="en_GB.UTF-8"
LC_TIME="en_GB.UTF-8"
LC_COLLATE="en_GB.UTF-8"
LC_MONETARY="en_GB.UTF-8"
LC_MESSAGES=C
LC_PAPER="en_GB.UTF-8"
LC_NAME="en_GB.UTF-8"
LC_ADDRESS="en_GB.UTF-8"
LC_TELEPHONE="en_GB.UTF-8"
LC_MEASUREMENT="en_GB.UTF-8"
LC_IDENTIFICATION="en_GB.UTF-8"
LC_ALL=
localectl
System Locale: LANG=en_US.UTF-8
VC Keymap: n/a
X11 Layout: n/a
I had set one of the local variable to 'C'
and I doesn't see any reason to disable that. (I doesn't know what does that that mean, I only know LANG
)
from translate-shell.
@pickfire OK. Those LC_*
variables are not so relevant for checking whether user's locale supports UTF-8 (they are mainly used for programs to determine in which language messages are shown). Your LANG
(en_GB.UTF-8
) has got it covered already.
Shall be fixed in the develop
branch now.
from translate-shell.
Thanks.
from translate-shell.
After a few git pull, when I ran trans
, it still shows the same output which is:
[WARNING] Your locale codeset (C) is not UTF-8.
[ERROR] Oops! Something went wrong and I can't translate it for you :(
from translate-shell.
Related Issues (20)
- Usage with persian language HOT 4
- New feature advice: collect history to an output text file HOT 1
- macOS,为什么输入命令无法启动translate-shell HOT 1
- What are the limitations? HOT 1
- Garbled html in Korean translations HOT 3
- I can't use -play and -speak options together in the same time! HOT 2
- Add pot/po translation support
- 无法使用
- Add option to force retry if connection is lost
- Voice output unavailable
- -no-autocorrect doesn't work with Google translate HOT 2
- Stuck at getting output for RTL languages HOT 2
- Strange bug with some Chinese sentences containg : HOT 3
- gpg public key doesnt seems to be working HOT 1
- not reading .curlrc HOT 7
- Show target language on REPL mode HOT 3
- Space bar not working on REPL mode HOT 1
- sentence HOT 1
- Inconsistent inclusion of nikud in Hebrew results HOT 2
- Support socks proxy HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from translate-shell.