Opensocial Gadget 앱의 현지화
-
03-07-2019 - |
문제
나는 Obensocial Application에 다국어 지원을 추가하려고 노력하고 있습니다. 가제트 XML 마크 업에서 내 자신의 메시지 번들에 연결할 수 있습니다.
<Module>
<ModulePrefs title="Hello" description="Message bundle demo">
<Require feature="opensocial-0.7"/>
<Locale lang="en" messages="http://example.com/hello/en_ALL.xml"/>
</ModulePrefs>
. . .
</Module>
그러나 실제로 그들로부터 값을 어떻게 추출합니까?
해결책
값을 추출하려면 사용해야합니다 getmsg 방법
var prefs = new gadgets.Prefs();
var msg = prefs.getMsg('hello_world');
제휴하지 않습니다 StackOverflow