Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否有宝石可以检测语言是否为非英语?
我需要传入一个字符串,如果它不是英文的,则返回一个适当的值。
谢谢
谷歌翻译 API 有一个 gem,它可以处理语言检测等。这是一项付费服务:https ://developers.google.com/translate/v2/libraries
WhatLanguage gem是您最好的选择。但它并不完美。
我正在使用我非常喜欢的CLD,简洁易用,试一试。