{"action":"created","comment":{"url":"https://api.github.com/repos/elementary/website/pulls/comments/195925252","pull_request_review_id":129385735,"id":195925252,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NTkyNTI1Mg==","diff_hunk":"@@ -417,54 +378,108 @@ Let's review all we've learned to do:\n * Keep our projects organized into branches\n * License our app under the GPL and declare our app's authors in a standardized manner\n * Create a .desktop file using RDNN that tells the computer how to display our app in the Applications Menu and the Dock\n-* Set up a CMake build system that contains all the rules for building our app and installing it cleanly\n+* Set up a Meson build system that contains all the rules for building our app and installing it cleanly\n \n-That's a lot! You're well on your way to becoming a bonified app developer for elementary OS. Give yourself a pat on the back, then take some time to play around with this example. Change the names of files and see if you can still build and install them properly. Ask another developer to clone your repo from GitHub and see if it builds and installs cleanly on their computer. If so, you've just distributed your first app! When you're ready, we'll move onto the next section: Packaging.\n+That's a lot! You're well on your way to becoming a bonified app developer for elementary OS. Give yourself a pat on the back, then take some time to play around with this example. Change the names of files and see if you can still build and install them properly. Ask another developer to clone your repo from GitHub and see if it builds and installs cleanly on their computer. If so, you've just distributed your first app! When you're ready, we'll move onto the next section: Translations.\n \n # Adding Translations {#Adding-Translations}\n-Now that you've learned about CMake, the next step is to make your app able to be translated to different languages. The first thing you need to know is how to convert strings in your code into translatable strings. Here's an example:\n+Now that you've learned about Meson, the next step is to make your app able to be translated to different languages. The first thing you need to know is how to convert strings in your code into translatable strings. Here's an example:\n \n         stdout.printf (\"Not Translatable string\");\n         stdout.printf (_(\"Translatable string!\"));\n \n         string normal = \"Another non-translatable string\";\n         string translated = _(\"Another translatable string\");\n \n-See the difference? We just added `_()` around the string! Well, that was easy!\n+See the difference? We just added `_()` around the string! Well, that was easy! Go back to your project and make all your strings translatable by adding `_()`.\n+\n+Now we have to make some changes to our Meson build system and add a couple new files to describe which files we want to translate and which languages we want to translate into.\n \n-1. Go back to your project and make all your strings translatable by adding `_()`\n+1. Open up your \"meson.build\" build and add these lines below your project declaration:\n \n-2. Add the following lines in the \"CMakeLists.txt\" file you created a moment ago:\n+        # Include the translations module\n+        i18n = import('i18n')\n \n-        # Translation files\n-        set (GETTEXT_PACKAGE \"${CMAKE_PROJECT_NAME}\")\n-        add_definitions (-DGETTEXT_PACKAGE=\\\"${GETTEXT_PACKAGE}\\\")\n-        add_subdirectory (po)\n+        # Set our translation domain\n+        add_global_arguments('-DGETTEXT_PACKAGE=\"@0@\"'.format (meson.project_name()), language:'c')\n \n-3. Create a directory named \"po\" on the root folder of your project. Inside of your po directory you will need to create another CMakeLists.txt file. This time, it's contents will be:\n+2. Remove the lines that install your .desktop and appdata files and replace them with the following:\n \n-        include (Translations)\n-            add_translations_directory(${GETTEXT_PACKAGE})\n-            add_translations_catalog(${GETTEXT_PACKAGE}\n-            ../src/\n+        #Translate and install our .desktop file\n+        i18n.merge_file(\n+            input: meson.project_name() + '.desktop.in',\n+            output: meson.project_name() + '.desktop',\n+            po_dir: join_paths(meson.source_root(), 'po'),\n+            type: 'desktop',\n+            install: true,\n+            install_dir: join_paths(get_option('datadir'), 'applications')\n         )\n \n-4. On your build directory execute the following commands:\n+        #Translate and install our .appdata file\n+        i18n.merge_file(\n+            input: meson.project_name() + '.appdata.xml.in',\n+            output: meson.project_name() + '.appdata.xml',\n+            po_dir: join_paths(meson.source_root(), 'po'),\n+            install: true,\n+            install_dir: join_paths(get_option('datadir'), 'metainfo')\n+        )\n+\n+    The `merge_file` method combines translating and installing files, similarly to how the `executable` method combines building and installing your app.\n+\n+3. Still in this file, add the following as the last line:\n+\n+        subdir('po')\n+\n+4. You might have noticed in step 2 that the `merge_file` method has an `input` and `output`. We're going to append the additional extension `.in` to our .desktop and .appdata.xml files so that this method can take the untranslated files and produce translated files with the correct names.\n \n     ```bash\n-    cmake -DCMAKE_INSTALL_PREFIX=/usr ../\n-    make pot\n+    git mv data/com.github.yourusername.yourrepositoryname.desktop data/com.github.yourusername.yourrepositoryname.desktop.in\n+    git mv data/com.github.yourusername.yourrepositoryname.appdata.xml data/com.github.yourusername.yourrepositoryname.appdata.xml.in\n     ```\n \n-5. Don't forget to add this new directory and it's contents to git\n+   We use the `git mv` command here instead of renaming in the file manager or with `mv` so that `git` can keep track of the file rename as part of our revision history.\n+\n+5. Now, Create a directory named \"po\" in the root folder of your project. Inside of your po directory you will need to create another meson.build file. This time, its contents will be:\n+\n+        i18n.gettext(meson.project_name(),\n+          args: [\n+            '--directory=' + meson.source_root(),\n+            '--from-code=UTF-8'\n+          ]\n+        )\n+\n+6. Inside of \"po\" create another file called \"POTFILES\" that will contain paths to all of the files you want to translate. For us, this looks like:\n+\n+        src/Application.vala\n+        data/com.github.yourusername.yourrepositoryname.desktop.in\n+        data/com.github.yourusername.yourrepositoryname.appdata.xml.in\n+\n+7. We have one more file to create in the \"po\" directory. This file will be named \"LINGUAS\" and it should contain the two-letter language codes for all languages you want to provide translations for. As an example, let's add German and Spanish\n+\n+        de\n+        es\n+\n+8. Now it's time to go back to your build directory and generate some new files! The first one is our translation template or `.pot` file:\n+\n+        ninja com.github.yourusername.yourrepositoryname-pot\n+\n+    After running this command you should notice a new file in the po directory containing all of the translatable strings for your app.\n+\n+9. Now we can use this template file to generate translation files for each of the languages we listed in the LINGUAS file with the following command:\n+\n+        ninja com.github.yourusername.yourrepositoryname-update-po\n+\n+    You should notice two new files in your po directory called `de.po` and `es.po`. These files are now ready for translaters to localize your app!\n+\n+10. Last step. Don't forget to add all of the new files we created in the po directory to git:\n \n     ```bash\n     git add po/","path":"docs/code/getting-started.md","position":351,"original_position":351,"commit_id":"d982c2840dd24c47d31a57963d8fb57862afa71c","original_commit_id":"d982c2840dd24c47d31a57963d8fb57862afa71c","user":{"login":"ryonakano","id":26003928,"node_id":"MDQ6VXNlcjI2MDAzOTI4","avatar_url":"https://avatars2.githubusercontent.com/u/26003928?v=4","gravatar_id":"","url":"https://api.github.com/users/ryonakano","html_url":"https://github.com/ryonakano","followers_url":"https://api.github.com/users/ryonakano/followers","following_url":"https://api.github.com/users/ryonakano/following{/other_user}","gists_url":"https://api.github.com/users/ryonakano/gists{/gist_id}","starred_url":"https://api.github.com/users/ryonakano/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryonakano/subscriptions","organizations_url":"https://api.github.com/users/ryonakano/orgs","repos_url":"https://api.github.com/users/ryonakano/repos","events_url":"https://api.github.com/users/ryonakano/events{/privacy}","received_events_url":"https://api.github.com/users/ryonakano/received_events","type":"User","site_admin":false},"body":"I suppose we have to add `src/Application.vala`, `meson.build`, and `data` directory.\r\nThat is to say, `git add po/ src/Application.vala meson data/`","created_at":"2018-06-17T10:48:03Z","updated_at":"2018-06-17T10:48:04Z","html_url":"https://github.com/elementary/website/pull/1937#discussion_r195925252","pull_request_url":"https://api.github.com/repos/elementary/website/pulls/1937","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/elementary/website/pulls/comments/195925252"},"html":{"href":"https://github.com/elementary/website/pull/1937#discussion_r195925252"},"pull_request":{"href":"https://api.github.com/repos/elementary/website/pulls/1937"}}},"pull_request":{"url":"https://api.github.com/repos/elementary/website/pulls/1937","id":183135589,"node_id":"MDExOlB1bGxSZXF1ZXN0MTgzMTM1NTg5","html_url":"https://github.com/elementary/website/pull/1937","diff_url":"https://github.com/elementary/website/pull/1937.diff","patch_url":"https://github.com/elementary/website/pull/1937.patch","issue_url":"https://api.github.com/repos/elementary/website/issues/1937","number":1937,"state":"open","locked":false,"title":"Juno docs updates","user":{"login":"danrabbit","id":7277719,"node_id":"MDQ6VXNlcjcyNzc3MTk=","avatar_url":"https://avatars3.githubusercontent.com/u/7277719?v=4","gravatar_id":"","url":"https://api.github.com/users/danrabbit","html_url":"https://github.com/danrabbit","followers_url":"https://api.github.com/users/danrabbit/followers","following_url":"https://api.github.com/users/danrabbit/following{/other_user}","gists_url":"https://api.github.com/users/danrabbit/gists{/gist_id}","starred_url":"https://api.github.com/users/danrabbit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danrabbit/subscriptions","organizations_url":"https://api.github.com/users/danrabbit/orgs","repos_url":"https://api.github.com/users/danrabbit/repos","events_url":"https://api.github.com/users/danrabbit/events{/privacy}","received_events_url":"https://api.github.com/users/danrabbit/received_events","type":"User","site_admin":false},"body":"Fixes #1885 \r\n\r\nThis should contain all the changes we need to make to docs for the Juno release","created_at":"2018-04-20T18:20:01Z","updated_at":"2018-06-17T10:48:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5f2aedd5b9b1108a5d4437a425f65443c90ab1de","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":164644942,"node_id":"MDU6TGFiZWwxNjQ2NDQ5NDI=","url":"https://api.github.com/repos/elementary/website/labels/Status:%20In%20Progress","name":"Status: In Progress","color":"CBE7EF","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/elementary/website/pulls/1937/commits","review_comments_url":"https://api.github.com/repos/elementary/website/pulls/1937/comments","review_comment_url":"https://api.github.com/repos/elementary/website/pulls/comments{/number}","comments_url":"https://api.github.com/repos/elementary/website/issues/1937/comments","statuses_url":"https://api.github.com/repos/elementary/website/statuses/d982c2840dd24c47d31a57963d8fb57862afa71c","head":{"label":"elementary:juno-docs-updates","ref":"juno-docs-updates","sha":"d982c2840dd24c47d31a57963d8fb57862afa71c","user":{"login":"elementary","id":1978534,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE5Nzg1MzQ=","avatar_url":"https://avatars0.githubusercontent.com/u/1978534?v=4","gravatar_id":"","url":"https://api.github.com/users/elementary","html_url":"https://github.com/elementary","followers_url":"https://api.github.com/users/elementary/followers","following_url":"https://api.github.com/users/elementary/following{/other_user}","gists_url":"https://api.github.com/users/elementary/gists{/gist_id}","starred_url":"https://api.github.com/users/elementary/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elementary/subscriptions","organizations_url":"https://api.github.com/users/elementary/orgs","repos_url":"https://api.github.com/users/elementary/repos","events_url":"https://api.github.com/users/elementary/events{/privacy}","received_events_url":"https://api.github.com/users/elementary/received_events","type":"Organization","site_admin":false},"repo":{"id":28882452,"node_id":"MDEwOlJlcG9zaXRvcnkyODg4MjQ1Mg==","name":"website","full_name":"elementary/website","owner":{"login":"elementary","id":1978534,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE5Nzg1MzQ=","avatar_url":"https://avatars0.githubusercontent.com/u/1978534?v=4","gravatar_id":"","url":"https://api.github.com/users/elementary","html_url":"https://github.com/elementary","followers_url":"https://api.github.com/users/elementary/followers","following_url":"https://api.github.com/users/elementary/following{/other_user}","gists_url":"https://api.github.com/users/elementary/gists{/gist_id}","starred_url":"https://api.github.com/users/elementary/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elementary/subscriptions","organizations_url":"https://api.github.com/users/elementary/orgs","repos_url":"https://api.github.com/users/elementary/repos","events_url":"https://api.github.com/users/elementary/events{/privacy}","received_events_url":"https://api.github.com/users/elementary/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/elementary/website","description":"The elementary.io website","fork":false,"url":"https://api.github.com/repos/elementary/website","forks_url":"https://api.github.com/repos/elementary/website/forks","keys_url":"https://api.github.com/repos/elementary/website/keys{/key_id}","collaborators_url":"https://api.github.com/repos/elementary/website/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/elementary/website/teams","hooks_url":"https://api.github.com/repos/elementary/website/hooks","issue_events_url":"https://api.github.com/repos/elementary/website/issues/events{/number}","events_url":"https://api.github.com/repos/elementary/website/events","assignees_url":"https://api.github.com/repos/elementary/website/assignees{/user}","branches_url":"https://api.github.com/repos/elementary/website/branches{/branch}","tags_url":"https://api.github.com/repos/elementary/website/tags","blobs_url":"https://api.github.com/repos/elementary/website/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/elementary/website/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/elementary/website/git/refs{/sha}","trees_url":"https://api.github.com/repos/elementary/website/git/trees{/sha}","statuses_url":"https://api.github.com/repos/elementary/website/statuses/{sha}","languages_url":"https://api.github.com/repos/elementary/website/languages","stargazers_url":"https://api.github.com/repos/elementary/website/stargazers","contributors_url":"https://api.github.com/repos/elementary/website/contributors","subscribers_url":"https://api.github.com/repos/elementary/website/subscribers","subscription_url":"https://api.github.com/repos/elementary/website/subscription","commits_url":"https://api.github.com/repos/elementary/website/commits{/sha}","git_commits_url":"https://api.github.com/repos/elementary/website/git/commits{/sha}","comments_url":"https://api.github.com/repos/elementary/website/comments{/number}","issue_comment_url":"https://api.github.com/repos/elementary/website/issues/comments{/number}","contents_url":"https://api.github.com/repos/elementary/website/contents/{+path}","compare_url":"https://api.github.com/repos/elementary/website/compare/{base}...{head}","merges_url":"https://api.github.com/repos/elementary/website/merges","archive_url":"https://api.github.com/repos/elementary/website/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/elementary/website/downloads","issues_url":"https://api.github.com/repos/elementary/website/issues{/number}","pulls_url":"https://api.github.com/repos/elementary/website/pulls{/number}","milestones_url":"https://api.github.com/repos/elementary/website/milestones{/number}","notifications_url":"https://api.github.com/repos/elementary/website/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/elementary/website/labels{/name}","releases_url":"https://api.github.com/repos/elementary/website/releases{/id}","deployments_url":"https://api.github.com/repos/elementary/website/deployments","created_at":"2015-01-06T20:39:35Z","updated_at":"2018-06-17T00:06:38Z","pushed_at":"2018-06-17T08:19:35Z","git_url":"git://github.com/elementary/website.git","ssh_url":"git@github.com:elementary/website.git","clone_url":"https://github.com/elementary/website.git","svn_url":"https://github.com/elementary/website","homepage":"https://elementary.io","size":109738,"stargazers_count":787,"watchers_count":787,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":491,"mirror_url":null,"archived":false,"open_issues_count":128,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":491,"open_issues":128,"watchers":787,"default_branch":"master"}},"base":{"label":"elementary:master","ref":"master","sha":"8828d374bf73f01ada0fcf482ceda51c537f9cdf","user":{"login":"elementary","id":1978534,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE5Nzg1MzQ=","avatar_url":"https://avatars0.githubusercontent.com/u/1978534?v=4","gravatar_id":"","url":"https://api.github.com/users/elementary","html_url":"https://github.com/elementary","followers_url":"https://api.github.com/users/elementary/followers","following_url":"https://api.github.com/users/elementary/following{/other_user}","gists_url":"https://api.github.com/users/elementary/gists{/gist_id}","starred_url":"https://api.github.com/users/elementary/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elementary/subscriptions","organizations_url":"https://api.github.com/users/elementary/orgs","repos_url":"https://api.github.com/users/elementary/repos","events_url":"https://api.github.com/users/elementary/events{/privacy}","received_events_url":"https://api.github.com/users/elementary/received_events","type":"Organization","site_admin":false},"repo":{"id":28882452,"node_id":"MDEwOlJlcG9zaXRvcnkyODg4MjQ1Mg==","name":"website","full_name":"elementary/website","owner":{"login":"elementary","id":1978534,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE5Nzg1MzQ=","avatar_url":"https://avatars0.githubusercontent.com/u/1978534?v=4","gravatar_id":"","url":"https://api.github.com/users/elementary","html_url":"https://github.com/elementary","followers_url":"https://api.github.com/users/elementary/followers","following_url":"https://api.github.com/users/elementary/following{/other_user}","gists_url":"https://api.github.com/users/elementary/gists{/gist_id}","starred_url":"https://api.github.com/users/elementary/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elementary/subscriptions","organizations_url":"https://api.github.com/users/elementary/orgs","repos_url":"https://api.github.com/users/elementary/repos","events_url":"https://api.github.com/users/elementary/events{/privacy}","received_events_url":"https://api.github.com/users/elementary/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/elementary/website","description":"The elementary.io website","fork":false,"url":"https://api.github.com/repos/elementary/website","forks_url":"https://api.github.com/repos/elementary/website/forks","keys_url":"https://api.github.com/repos/elementary/website/keys{/key_id}","collaborators_url":"https://api.github.com/repos/elementary/website/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/elementary/website/teams","hooks_url":"https://api.github.com/repos/elementary/website/hooks","issue_events_url":"https://api.github.com/repos/elementary/website/issues/events{/number}","events_url":"https://api.github.com/repos/elementary/website/events","assignees_url":"https://api.github.com/repos/elementary/website/assignees{/user}","branches_url":"https://api.github.com/repos/elementary/website/branches{/branch}","tags_url":"https://api.github.com/repos/elementary/website/tags","blobs_url":"https://api.github.com/repos/elementary/website/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/elementary/website/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/elementary/website/git/refs{/sha}","trees_url":"https://api.github.com/repos/elementary/website/git/trees{/sha}","statuses_url":"https://api.github.com/repos/elementary/website/statuses/{sha}","languages_url":"https://api.github.com/repos/elementary/website/languages","stargazers_url":"https://api.github.com/repos/elementary/website/stargazers","contributors_url":"https://api.github.com/repos/elementary/website/contributors","subscribers_url":"https://api.github.com/repos/elementary/website/subscribers","subscription_url":"https://api.github.com/repos/elementary/website/subscription","commits_url":"https://api.github.com/repos/elementary/website/commits{/sha}","git_commits_url":"https://api.github.com/repos/elementary/website/git/commits{/sha}","comments_url":"https://api.github.com/repos/elementary/website/comments{/number}","issue_comment_url":"https://api.github.com/repos/elementary/website/issues/comments{/number}","contents_url":"https://api.github.com/repos/elementary/website/contents/{+path}","compare_url":"https://api.github.com/repos/elementary/website/compare/{base}...{head}","merges_url":"https://api.github.com/repos/elementary/website/merges","archive_url":"https://api.github.com/repos/elementary/website/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/elementary/website/downloads","issues_url":"https://api.github.com/repos/elementary/website/issues{/number}","pulls_url":"https://api.github.com/repos/elementary/website/pulls{/number}","milestones_url":"https://api.github.com/repos/elementary/website/milestones{/number}","notifications_url":"https://api.github.com/repos/elementary/website/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/elementary/website/labels{/name}","releases_url":"https://api.github.com/repos/elementary/website/releases{/id}","deployments_url":"https://api.github.com/repos/elementary/website/deployments","created_at":"2015-01-06T20:39:35Z","updated_at":"2018-06-17T00:06:38Z","pushed_at":"2018-06-17T08:19:35Z","git_url":"git://github.com/elementary/website.git","ssh_url":"git@github.com:elementary/website.git","clone_url":"https://github.com/elementary/website.git","svn_url":"https://github.com/elementary/website","homepage":"https://elementary.io","size":109738,"stargazers_count":787,"watchers_count":787,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":491,"mirror_url":null,"archived":false,"open_issues_count":128,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":491,"open_issues":128,"watchers":787,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/elementary/website/pulls/1937"},"html":{"href":"https://github.com/elementary/website/pull/1937"},"issue":{"href":"https://api.github.com/repos/elementary/website/issues/1937"},"comments":{"href":"https://api.github.com/repos/elementary/website/issues/1937/comments"},"review_comments":{"href":"https://api.github.com/repos/elementary/website/pulls/1937/comments"},"review_comment":{"href":"https://api.github.com/repos/elementary/website/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/elementary/website/pulls/1937/commits"},"statuses":{"href":"https://api.github.com/repos/elementary/website/statuses/d982c2840dd24c47d31a57963d8fb57862afa71c"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"ryonakano"}}