[Freeipa-devel] admiyo-freeipa-0038-I18N-of-RPC.patch
Adam Young
ayoung at redhat.com
Mon Sep 20 18:19:02 UTC 2010
This is the simplest, most global approach to I18N. It does complete
I18N on the server side by setting the locale on each request, based on
the value in the http header.
If we go this route, I can remove the parameter as a parameter on the
metadata plugin
To test this:
curl -H "Content-Type:application/json" -H
"Accept:applicaton/json" -H "Accept-Language:uk" --negotiate -u
: --cacert /etc/ipa/ca.crt -d
'{"method":"plugin_metadata","params":[[""],{"all":true}],"id":6}'
-X POST http://localhost:8888/ipa/json | grep label
And note that is should work for any RPC. For example
:"user_find","params":[[""],{"all":true}],"id":6}' -X
POST http://localhost:8888/ipa/json | grep summary
% Total % Received % Xferd Average Speed Time Time Time
Current
Dload Upload Total Spent Left
Speed
100 13114 0 13114 0 58 42902 189 --:--:-- --:--:-- --:--:--
42996
"summary":
"\u0432\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e
\u0432\u0456\u0434\u043f\u043e\u0432\u0456\u0434\u043d\u0456\u0441\u0442\u044c
7
\u043a\u043e\u0440\u0438\u0441\u0442\u0443\u0432\u0430\u0447\u0456\u0432",
[ayoung at ipa freeipa]$ curl -H "Content-Type:application/json"
-H "Accept:applicaton/json" -H "Accept-Language:es" --negotiate
-u : --cacert /etc/ipa/ca.crt -d
'{"method":"user_find","params":[[""],{"all":true}],"id":6}' -X
POST http://localhost:8888/ipa/json | grep summary
% Total % Received % Xferd Average Speed Time Time Time
Current
Dload Upload Total Spent Left
Speed
100 12917 0 12917 0 58 48572 218 --:--:-- --:--:-- --:--:--
48743
"summary": "7 usuarios coincidentes",
-------------- next part --------------
A non-text attachment was scrubbed...
Name: admiyo-freeipa-0038-I18N-of-RPC.patch
Type: text/x-patch
Size: 1574 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20100920/da9e4227/attachment.bin>
More information about the Freeipa-devel
mailing list