I would like to determine, if there's a translation to current language for a given string. I'd like to write something like:
if not translation_available("my string"):
log_warning_somewhere()
Run Code Online (Sandbox Code Playgroud)
I didn't find anything appropriate. The ugettext
function just returns the translation or the original string (if the translation isn't available) but without any option to determine if the translation is there or isn't.
Thanks.
有没有办法如何以编程方式获取特定facebook对象的字段列表?
我知道有相关的文档,但我需要一些内省 - 我们正在构建一个工具,使用户可以从现有字段中进行选择.
我的意思是:给我一个用户字段列表,响应:{"id","name","first_name",...}
或者某种方式如何获取一个对象的所有字段并从中派生出来?