小编pcv*_*pcv的帖子

In Django, how to determine if translation for a given text is available?

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.

python django internationalization

7
推荐指数
1
解决办法
975
查看次数

FB Graph API:通过API获取对象字段列表的方法

有没有办法如何以编程方式获取特定facebook对象的字段列表?

我知道有相关的文档,但我需要一些内省 - 我们正在构建一个工具,使用户可以从现有字段中进行选择.

我的意思是:给我一个用户字段列表,响应:{"id","name","first_name",...}

或者某种方式如何获取一个对象的所有字段并从中派生出来?

facebook facebook-graph-api

6
推荐指数
1
解决办法
5492
查看次数