{"action":"created","comment":{"url":"https://api.github.com/repos/edx/edx-documentation/pulls/comments/55605299","id":55605299,"diff_hunk":"@@ -40,4 +44,83 @@ The LMS requires XBlocks to have the following properties.\n   * ``video``\n   * ``other``\n \n+****************************\n+Internationalization Support\n+****************************\n+\n+The LMS is currently capable of supporting internationalization (i18n) and localization (l10n) of static XBlock chrome\n+and control strings.  Translation of user-generated content stored as XBlock state is not currently supported.\n+\n+To present XBlock language translations in the LMS you must include the translated strings for your chosen \"locale\"\n+in the GNU Gettext Portable Object file format.  Translated strings must be stored in a \"domain\" file named \"text.po\".\n+There is no limit on the number of locales that can be included with your XBlock.\n+\n+You can learn more about the GNU Gettext Portable Object file format using the following resources:\n+\n+* https://www.gnu.org/software/gettext/\n+* https://en.wikipedia.org/wiki/Gettext\n+* https://www.drupal.org/node/1814954\n+\n+Each \"text.po\" domain file consists of one or more string/translation pairs for the language/locale.  Further, each\n+translation pair consists of two fields: \"msgid\" for the base string, and \"msgstr\" for its corresponding translation.\n+\n+Adding Translated Strings to your XBlock\n+****************************************\n+\n+#. Create a directory within your XBlock code project named \"translations\".  This directory should be located at the\n+   same level in your code project as your XBlock implementation file.  For example:\n+\n+   * ``http://github.com/my_org/my_xblock/my_xblock/my_xblock.py``\n+   * ``http://github.com/my_org/my_xblock/my_xblock/translations/``\n+\n+#. Create a set of locale-specific directories for each of your locales within this new \"translations\" directory.\n+   Include an \"LC_MESSAGES\" directory with each locale directory.\n+\n+   * ``../my_xblock/translations/ar/LC_MESSAGES/``\n+   * ``../my_xblock/translations/es-es/LC_MESSAGES/``\n+\n+#. Place each locale's \"text.po\" domain file within the corresponding \"LC_MESSAGES\" directory\n+\n+   * ``../my_xblock/translations/ar/LC_MESSAGES/text.po``\n+   * ``../my_xblock/translations/es-es/LC_MESSAGES/text.po``\n+\n+#. Compile your \"text.po\" files into binary \"text.mo\" files using the Gettext \"msgfmt\" command, and include these\n+   \"text.mo\" files alongside your \"text.po\" files in your code project.\n+\n+   * ``../my_xblock/translations/ar/LC_MESSAGES/text.mo``\n+   * ``../my_xblock/translations/ar/LC_MESSAGES/text.po``\n+\n+The resulting directory/file structure should look like this:\n+\n+.. code-block:: text\n+\n+    ../my_xblock","path":"en_us/xblock-tutorial/source/edx_platform/edx_lms.rst","position":74,"original_position":74,"commit_id":"608c5ee2b8162bc5fb6af44acbe2e6c13aa63591","original_commit_id":"608c5ee2b8162bc5fb6af44acbe2e6c13aa63591","user":{"login":"nedbat","id":23789,"avatar_url":"https://avatars.githubusercontent.com/u/23789?v=3","gravatar_id":"","url":"https://api.github.com/users/nedbat","html_url":"https://github.com/nedbat","followers_url":"https://api.github.com/users/nedbat/followers","following_url":"https://api.github.com/users/nedbat/following{/other_user}","gists_url":"https://api.github.com/users/nedbat/gists{/gist_id}","starred_url":"https://api.github.com/users/nedbat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nedbat/subscriptions","organizations_url":"https://api.github.com/users/nedbat/orgs","repos_url":"https://api.github.com/users/nedbat/repos","events_url":"https://api.github.com/users/nedbat/events{/privacy}","received_events_url":"https://api.github.com/users/nedbat/received_events","type":"User","site_admin":false},"body":"Why does this start with \"..\" ?","created_at":"2016-03-09T22:52:47Z","updated_at":"2016-03-09T22:52:47Z","html_url":"https://github.com/edx/edx-documentation/pull/904#discussion_r55605299","pull_request_url":"https://api.github.com/repos/edx/edx-documentation/pulls/904","_links":{"self":{"href":"https://api.github.com/repos/edx/edx-documentation/pulls/comments/55605299"},"html":{"href":"https://github.com/edx/edx-documentation/pull/904#discussion_r55605299"},"pull_request":{"href":"https://api.github.com/repos/edx/edx-documentation/pulls/904"}}},"pull_request":{"url":"https://api.github.com/repos/edx/edx-documentation/pulls/904","id":62084768,"html_url":"https://github.com/edx/edx-documentation/pull/904","diff_url":"https://github.com/edx/edx-documentation/pull/904.diff","patch_url":"https://github.com/edx/edx-documentation/pull/904.patch","issue_url":"https://api.github.com/repos/edx/edx-documentation/issues/904","number":904,"state":"open","locked":false,"title":"mattdrayer/xblock-i18n: Add documentation about XBlock I18N/L10N support","user":{"login":"mattdrayer","id":4520595,"avatar_url":"https://avatars.githubusercontent.com/u/4520595?v=3","gravatar_id":"","url":"https://api.github.com/users/mattdrayer","html_url":"https://github.com/mattdrayer","followers_url":"https://api.github.com/users/mattdrayer/followers","following_url":"https://api.github.com/users/mattdrayer/following{/other_user}","gists_url":"https://api.github.com/users/mattdrayer/gists{/gist_id}","starred_url":"https://api.github.com/users/mattdrayer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattdrayer/subscriptions","organizations_url":"https://api.github.com/users/mattdrayer/orgs","repos_url":"https://api.github.com/users/mattdrayer/repos","events_url":"https://api.github.com/users/mattdrayer/events{/privacy}","received_events_url":"https://api.github.com/users/mattdrayer/received_events","type":"User","site_admin":false},"body":"@nedbat @lamagnifica -- First draft of XBlock I18N/L10N documentation -- happy to add/edit, just let me know what you would like to see.","created_at":"2016-03-08T15:15:39Z","updated_at":"2016-03-09T22:52:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"987f9e06b42004857bd9d0acf6d27259c5d6f974","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/edx/edx-documentation/pulls/904/commits","review_comments_url":"https://api.github.com/repos/edx/edx-documentation/pulls/904/comments","review_comment_url":"https://api.github.com/repos/edx/edx-documentation/pulls/comments{/number}","comments_url":"https://api.github.com/repos/edx/edx-documentation/issues/904/comments","statuses_url":"https://api.github.com/repos/edx/edx-documentation/statuses/608c5ee2b8162bc5fb6af44acbe2e6c13aa63591","head":{"label":"edx:mattdrayer/xblock-i18n","ref":"mattdrayer/xblock-i18n","sha":"608c5ee2b8162bc5fb6af44acbe2e6c13aa63591","user":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"repo":{"id":23839256,"name":"edx-documentation","full_name":"edx/edx-documentation","owner":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/edx/edx-documentation","description":"For published versions of the edX documentation, visit:","fork":false,"url":"https://api.github.com/repos/edx/edx-documentation","forks_url":"https://api.github.com/repos/edx/edx-documentation/forks","keys_url":"https://api.github.com/repos/edx/edx-documentation/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edx/edx-documentation/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edx/edx-documentation/teams","hooks_url":"https://api.github.com/repos/edx/edx-documentation/hooks","issue_events_url":"https://api.github.com/repos/edx/edx-documentation/issues/events{/number}","events_url":"https://api.github.com/repos/edx/edx-documentation/events","assignees_url":"https://api.github.com/repos/edx/edx-documentation/assignees{/user}","branches_url":"https://api.github.com/repos/edx/edx-documentation/branches{/branch}","tags_url":"https://api.github.com/repos/edx/edx-documentation/tags","blobs_url":"https://api.github.com/repos/edx/edx-documentation/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edx/edx-documentation/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edx/edx-documentation/git/refs{/sha}","trees_url":"https://api.github.com/repos/edx/edx-documentation/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edx/edx-documentation/statuses/{sha}","languages_url":"https://api.github.com/repos/edx/edx-documentation/languages","stargazers_url":"https://api.github.com/repos/edx/edx-documentation/stargazers","contributors_url":"https://api.github.com/repos/edx/edx-documentation/contributors","subscribers_url":"https://api.github.com/repos/edx/edx-documentation/subscribers","subscription_url":"https://api.github.com/repos/edx/edx-documentation/subscription","commits_url":"https://api.github.com/repos/edx/edx-documentation/commits{/sha}","git_commits_url":"https://api.github.com/repos/edx/edx-documentation/git/commits{/sha}","comments_url":"https://api.github.com/repos/edx/edx-documentation/comments{/number}","issue_comment_url":"https://api.github.com/repos/edx/edx-documentation/issues/comments{/number}","contents_url":"https://api.github.com/repos/edx/edx-documentation/contents/{+path}","compare_url":"https://api.github.com/repos/edx/edx-documentation/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edx/edx-documentation/merges","archive_url":"https://api.github.com/repos/edx/edx-documentation/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edx/edx-documentation/downloads","issues_url":"https://api.github.com/repos/edx/edx-documentation/issues{/number}","pulls_url":"https://api.github.com/repos/edx/edx-documentation/pulls{/number}","milestones_url":"https://api.github.com/repos/edx/edx-documentation/milestones{/number}","notifications_url":"https://api.github.com/repos/edx/edx-documentation/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edx/edx-documentation/labels{/name}","releases_url":"https://api.github.com/repos/edx/edx-documentation/releases{/id}","deployments_url":"https://api.github.com/repos/edx/edx-documentation/deployments","created_at":"2014-09-09T15:29:04Z","updated_at":"2016-02-23T06:10:59Z","pushed_at":"2016-03-09T21:58:58Z","git_url":"git://github.com/edx/edx-documentation.git","ssh_url":"git@github.com:edx/edx-documentation.git","clone_url":"https://github.com/edx/edx-documentation.git","svn_url":"https://github.com/edx/edx-documentation","homepage":" http://docs.edx.org","size":95217,"stargazers_count":33,"watchers_count":33,"language":"Makefile","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":122,"mirror_url":null,"open_issues_count":21,"forks":122,"open_issues":21,"watchers":33,"default_branch":"master"}},"base":{"label":"edx:master","ref":"master","sha":"db5700460b8146ef75a2ae69e3fd1e945b9573c2","user":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"repo":{"id":23839256,"name":"edx-documentation","full_name":"edx/edx-documentation","owner":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/edx/edx-documentation","description":"For published versions of the edX documentation, visit:","fork":false,"url":"https://api.github.com/repos/edx/edx-documentation","forks_url":"https://api.github.com/repos/edx/edx-documentation/forks","keys_url":"https://api.github.com/repos/edx/edx-documentation/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edx/edx-documentation/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edx/edx-documentation/teams","hooks_url":"https://api.github.com/repos/edx/edx-documentation/hooks","issue_events_url":"https://api.github.com/repos/edx/edx-documentation/issues/events{/number}","events_url":"https://api.github.com/repos/edx/edx-documentation/events","assignees_url":"https://api.github.com/repos/edx/edx-documentation/assignees{/user}","branches_url":"https://api.github.com/repos/edx/edx-documentation/branches{/branch}","tags_url":"https://api.github.com/repos/edx/edx-documentation/tags","blobs_url":"https://api.github.com/repos/edx/edx-documentation/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edx/edx-documentation/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edx/edx-documentation/git/refs{/sha}","trees_url":"https://api.github.com/repos/edx/edx-documentation/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edx/edx-documentation/statuses/{sha}","languages_url":"https://api.github.com/repos/edx/edx-documentation/languages","stargazers_url":"https://api.github.com/repos/edx/edx-documentation/stargazers","contributors_url":"https://api.github.com/repos/edx/edx-documentation/contributors","subscribers_url":"https://api.github.com/repos/edx/edx-documentation/subscribers","subscription_url":"https://api.github.com/repos/edx/edx-documentation/subscription","commits_url":"https://api.github.com/repos/edx/edx-documentation/commits{/sha}","git_commits_url":"https://api.github.com/repos/edx/edx-documentation/git/commits{/sha}","comments_url":"https://api.github.com/repos/edx/edx-documentation/comments{/number}","issue_comment_url":"https://api.github.com/repos/edx/edx-documentation/issues/comments{/number}","contents_url":"https://api.github.com/repos/edx/edx-documentation/contents/{+path}","compare_url":"https://api.github.com/repos/edx/edx-documentation/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edx/edx-documentation/merges","archive_url":"https://api.github.com/repos/edx/edx-documentation/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edx/edx-documentation/downloads","issues_url":"https://api.github.com/repos/edx/edx-documentation/issues{/number}","pulls_url":"https://api.github.com/repos/edx/edx-documentation/pulls{/number}","milestones_url":"https://api.github.com/repos/edx/edx-documentation/milestones{/number}","notifications_url":"https://api.github.com/repos/edx/edx-documentation/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edx/edx-documentation/labels{/name}","releases_url":"https://api.github.com/repos/edx/edx-documentation/releases{/id}","deployments_url":"https://api.github.com/repos/edx/edx-documentation/deployments","created_at":"2014-09-09T15:29:04Z","updated_at":"2016-02-23T06:10:59Z","pushed_at":"2016-03-09T21:58:58Z","git_url":"git://github.com/edx/edx-documentation.git","ssh_url":"git@github.com:edx/edx-documentation.git","clone_url":"https://github.com/edx/edx-documentation.git","svn_url":"https://github.com/edx/edx-documentation","homepage":" http://docs.edx.org","size":95217,"stargazers_count":33,"watchers_count":33,"language":"Makefile","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":122,"mirror_url":null,"open_issues_count":21,"forks":122,"open_issues":21,"watchers":33,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/edx/edx-documentation/pulls/904"},"html":{"href":"https://github.com/edx/edx-documentation/pull/904"},"issue":{"href":"https://api.github.com/repos/edx/edx-documentation/issues/904"},"comments":{"href":"https://api.github.com/repos/edx/edx-documentation/issues/904/comments"},"review_comments":{"href":"https://api.github.com/repos/edx/edx-documentation/pulls/904/comments"},"review_comment":{"href":"https://api.github.com/repos/edx/edx-documentation/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/edx/edx-documentation/pulls/904/commits"},"statuses":{"href":"https://api.github.com/repos/edx/edx-documentation/statuses/608c5ee2b8162bc5fb6af44acbe2e6c13aa63591"}}}}