Hi Siavash, edX uses Django's built-in internationalization support, and this provides the gettext function. You can read about the JavaScript support here:
https://docs.djangoproject.com/en/1.10/topics/i18n/translation/#internationalization-in-javascript-code Unfortunately XBlock's don't currently support JavaScript i18n. See this JIRA ticket for details: https://openedx.atlassian.net/browse/WL-414 I hope this helps. - Andy On Mon, Sep 19, 2016 at 1:26 PM, Siavash Kavousi < siavash.kavousi...@gmail.com> wrote: > Hi, > > I wonder how gettext function in javascript files of edx-platform works? > And Is it possible to do the same thing on xblock? or Is there any other > way to translate javascript strings in xblock? > > -- > You received this message because you are subscribed to the Google Groups > "General Open edX discussion" group. > To view this discussion on the web visit https://groups.google.com/d/ > msgid/edx-code/fbc0ffa6-73b8-423c-a900-a04f105ba82b%40googlegroups.com > <https://groups.google.com/d/msgid/edx-code/fbc0ffa6-73b8-423c-a900-a04f105ba82b%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- *Andy Armstrong* edX | UI Architect | an...@edx.org 141 Portland Street, 9th floor Cambridge, MA 02139 http://www.edx.org <http://www.edxonline.org/> [image: http://www.e-learn.nl/media/blogs/e-learn/edX_Logo_Col_RGB_FINAL.jpg?mtime=1336074566] -- You received this message because you are subscribed to the Google Groups "General Open edX discussion" group. To view this discussion on the web visit https://groups.google.com/d/msgid/edx-code/CAG2ZmnDqoMTYBrTQkbXzaJjq%2BasP%2BDNGdWh1BPp5edJthOoMDQ%40mail.gmail.com.