{"id":20957,"date":"2018-03-27T11:35:27","date_gmt":"2018-03-27T15:35:27","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=20957"},"modified":"2018-03-27T11:35:27","modified_gmt":"2018-03-27T15:35:27","slug":"nsdoublelocalizedstrings-and-friends","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2018\/03\/27\/nsdoublelocalizedstrings-and-friends\/","title":{"rendered":"NSDoubleLocalizedStrings and Friends"},"content":{"rendered":"<p>The <tt>NSDoubleLocalizedStrings<\/tt> user default is a reasonably <a href=\"http:\/\/nshipster.com\/launch-arguments-and-environment-variables\/\">well-known<\/a> and <a href=\"https:\/\/developer.apple.com\/library\/content\/documentation\/MacOSX\/Conceptual\/BPInternational\/TestingYourInternationalApp\/TestingYourInternationalApp.html\">officially documented<\/a> localization debugging aide. It repeats the text of each localized string, making it double-length so that you can test whether your layout still works.<\/p>\n\n<p>Another <a href=\"https:\/\/mjtsai.com\/blog\/2003\/04\/07\/internationalizing_cocoa_\/\">longstanding<\/a> one is <tt>NSShowNonLocalizedStrings<\/tt>, which <a href=\"https:\/\/useyourloaf.com\/blog\/finding-non-localized-strings\/\">logs to Console<\/a> when a string <a href=\"https:\/\/www.objc.io\/issues\/9-strings\/string-localization\/\">can&rsquo;t be found<\/a>.<\/p>\n\n<p><a href=\"https:\/\/twitter.com\/thequinntaylor\/status\/977229943959560193\">Interface Builder<\/a> also lets you preview views using an &ldquo;Accented Pseudolanguage&rdquo; and a &ldquo;Bounded String Pseudolanguage.&rdquo; These <a href=\"https:\/\/twitter.com\/wakachamo\/status\/977286707966967808\">correspond<\/a> to the <tt>NSAccentuateLocalizedStrings<\/tt> and <tt>NSSurroundLocalizedStrings<\/tt> user defaults.<\/p>\n\n<p>Finally, there are <tt>NSForceRightToLeftLocalizedStrings<\/tt> and <tt>AppleTextDirection<\/tt> to enable the &ldquo;Right to Left Pseudolanguage.&rdquo; This lets you use test right-to-left layout (e.g. for Arabic) using strings from your development language.<\/p>","protected":false},"excerpt":{"rendered":"<p>The NSDoubleLocalizedStrings user default is a reasonably well-known and officially documented localization debugging aide. It repeats the text of each localized string, making it double-length so that you can test whether your layout still works. Another longstanding one is NSShowNonLocalizedStrings, which logs to Console when a string can&rsquo;t be found. Interface Builder also lets you [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"","apple_news_api_id":"","apple_news_api_modified_at":"","apple_news_api_revision":"","apple_news_api_share_url":"","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[],"tags":[56,649,370,31,1472,309,30,1529,226],"class_list":["post-20957","post","type-post","status-publish","format-standard","hentry","tag-debugging","tag-esoteric-preferences","tag-interfacebuilder","tag-ios","tag-ios-11","tag-localization","tag-mac","tag-macos-10-13","tag-xcode"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/20957","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=20957"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/20957\/revisions"}],"predecessor-version":[{"id":20958,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/20957\/revisions\/20958"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=20957"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=20957"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=20957"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}