{"id":62,"date":"2015-01-18T13:22:46","date_gmt":"2015-01-18T13:22:46","guid":{"rendered":"http:\/\/gkokot.com\/?p=62"},"modified":"2022-02-03T18:10:48","modified_gmt":"2022-02-03T18:10:48","slug":"how-to-use-multilingual-app-toolkit-in-universal-app","status":"publish","type":"post","link":"https:\/\/gkokot.com\/?p=62","title":{"rendered":"How to use Multilingual App Toolkit in Universal App"},"content":{"rendered":"<p>1. Create universal app<br \/>\nUniversal app has basically three projects:&nbsp; a project for Windows 8.1, a project for Windows Phone 8.1 and a Shared project.<\/p>\n<p><a href=\"https:\/\/gkokot.com\/wp-content\/uploads\/2015\/01\/Capture1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-69\" src=\"https:\/\/gkokot.com\/wp-content\/uploads\/2015\/01\/Capture1-300x194.png\" alt=\"Capture1\" width=\"300\" height=\"194\" srcset=\"https:\/\/gkokot.com\/wp-content\/uploads\/2015\/01\/Capture1-300x194.png 300w, https:\/\/gkokot.com\/wp-content\/uploads\/2015\/01\/Capture1.png 700w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\nBy putting resource files in the shared project they will be shared by both the Windows and Windows Phone projects.<\/p>\n<p><a href=\"https:\/\/gkokot.com\/wp-content\/uploads\/2015\/01\/Capture2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-68\" src=\"https:\/\/gkokot.com\/wp-content\/uploads\/2015\/01\/Capture2-300x226.png\" alt=\"Capture2\" width=\"300\" height=\"226\" srcset=\"https:\/\/gkokot.com\/wp-content\/uploads\/2015\/01\/Capture2-300x226.png 300w, https:\/\/gkokot.com\/wp-content\/uploads\/2015\/01\/Capture2.png 488w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>2. Enable MAT (in this case v3.1) one time for Windows 8.1 project and second time for Windows Phone 8.1<\/p>\n<p><a href=\"https:\/\/gkokot.com\/wp-content\/uploads\/2015\/01\/Capture3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-67\" src=\"https:\/\/gkokot.com\/wp-content\/uploads\/2015\/01\/Capture3-300x185.png\" alt=\"Capture3\" width=\"300\" height=\"185\" srcset=\"https:\/\/gkokot.com\/wp-content\/uploads\/2015\/01\/Capture3-300x185.png 300w, https:\/\/gkokot.com\/wp-content\/uploads\/2015\/01\/Capture3.png 563w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>3. Add new translation languages for each project.<\/p>\n<p><a href=\"https:\/\/gkokot.com\/wp-content\/uploads\/2015\/01\/Capture5.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-65\" src=\"https:\/\/gkokot.com\/wp-content\/uploads\/2015\/01\/Capture5-259x300.png\" alt=\"Capture5\" width=\"259\" height=\"300\" srcset=\"https:\/\/gkokot.com\/wp-content\/uploads\/2015\/01\/Capture5-259x300.png 259w, https:\/\/gkokot.com\/wp-content\/uploads\/2015\/01\/Capture5.png 415w\" sizes=\"(max-width: 259px) 100vw, 259px\" \/><\/a><\/p>\n<p>4. New strings should be added to the resource.resw file (in shared project)<br \/>\nAfter build current solution, new string will be added automatically to each .xlf file in both the Windows and Windows Phone projects.<\/p>\n<p><a href=\"https:\/\/gkokot.com\/wp-content\/uploads\/2015\/01\/Capture6.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-64\" src=\"https:\/\/gkokot.com\/wp-content\/uploads\/2015\/01\/Capture6-259x300.png\" alt=\"Capture6\" width=\"259\" height=\"300\" srcset=\"https:\/\/gkokot.com\/wp-content\/uploads\/2015\/01\/Capture6-259x300.png 259w, https:\/\/gkokot.com\/wp-content\/uploads\/2015\/01\/Capture6.png 389w\" sizes=\"(max-width: 259px) 100vw, 259px\" \/><\/a><\/p>\n<p>5. In Windows Phone project, add pre-build event commands to copy *.xlf files from Windows Phone project to Windows project,&nbsp; one command line for each .xlf file.<\/p>\n<p>in my example:<\/p>\n<p>COPY \/Y &#8220;$(SolutionDir)HubApp4\\HubApp4.WindowsPhone\\MultilingualResources\\HubApp4.WindowsPhone.fr.xlf&#8221; &#8220;$(SolutionDir)HubApp4\\HubApp4.Windows\\MultilingualResources\\HubApp4.Windows.fr.xlf&#8221;<\/p>\n<p><a href=\"https:\/\/gkokot.com\/wp-content\/uploads\/2015\/01\/Capture8.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-75\" src=\"https:\/\/gkokot.com\/wp-content\/uploads\/2015\/01\/Capture8-300x179.png\" alt=\"Capture8\" width=\"300\" height=\"179\" srcset=\"https:\/\/gkokot.com\/wp-content\/uploads\/2015\/01\/Capture8-300x179.png 300w, https:\/\/gkokot.com\/wp-content\/uploads\/2015\/01\/Capture8.png 700w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>6. Now you can translate all strings only in one project (in this example Windows Phone project).<br \/>\nDuring solution re-build, .xlf files will be update by translated version.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. Create universal app Universal app has basically three projects:&nbsp; a project for Windows 8.1,<a class=\"readmore btn btn-info\" href=\"https:\/\/gkokot.com\/?p=62\" rel=\"nofollow\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":1,"featured_media":70,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,5],"tags":[],"class_list":["post-62","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-c","category-visual-studio"],"_links":{"self":[{"href":"https:\/\/gkokot.com\/index.php?rest_route=\/wp\/v2\/posts\/62"}],"collection":[{"href":"https:\/\/gkokot.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gkokot.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gkokot.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gkokot.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=62"}],"version-history":[{"count":6,"href":"https:\/\/gkokot.com\/index.php?rest_route=\/wp\/v2\/posts\/62\/revisions"}],"predecessor-version":[{"id":193,"href":"https:\/\/gkokot.com\/index.php?rest_route=\/wp\/v2\/posts\/62\/revisions\/193"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gkokot.com\/index.php?rest_route=\/wp\/v2\/media\/70"}],"wp:attachment":[{"href":"https:\/\/gkokot.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=62"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gkokot.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=62"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gkokot.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=62"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}