{"id":1600,"date":"2007-10-24T16:31:00","date_gmt":"2007-10-24T20:31:00","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/2007\/10\/24\/a-localization-horror-story\/"},"modified":"2018-02-06T15:42:33","modified_gmt":"2018-02-06T20:42:33","slug":"a-localization-horror-story","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2007\/10\/24\/a-localization-horror-story\/","title":{"rendered":"A Localization Horror Story"},"content":{"rendered":"<p>The documentation for Perl&rsquo;s <a href=\"http:\/\/search.cpan.org\/dist\/Locale-Maketext\/lib\/Locale\/Maketext\/TPJ13.pod#A_Localization_Horror_Story:_It_Could_Happen_To_You\">Maketext module<\/a> mentions an interesting issue:<\/p>\r\n<blockquote cite=\"http:\/\/search.cpan.org\/dist\/Locale-Maketext\/lib\/Locale\/Maketext\/TPJ13.pod#A_Localization_Horror_Story:_It_Could_Happen_To_You\">\r\n<p>\r\nFirst off, your code for &ldquo;I scanned %g directory.&rdquo; or &ldquo;I scanned %g directories.&rdquo; assumes there&rsquo;s only singular or plural. But, to use linguistic jargon again, Arabic has grammatical number, like English (but unlike Chinese), but it&rsquo;s a three-term category: singular, dual, and plural. In other words, the way you say &ldquo;directory&rdquo; depends on whether there&rsquo;s one directory, or <i>two<\/i> of them, or <i>more than two<\/i> of them. Your test of <code>($directory == 1)<\/code> no longer does the job. And it means that where English&rsquo;s grammatical category of number necessitates only the two permutations of the first sentence based on &ldquo;directory [singular]&rdquo; and &ldquo;directories [plural],&rdquo; Arabic has three&mdash;and, worse, in the second sentence (&ldquo;Your query matched %g file in %g directory.&rdquo;), where English has four, Arabic has nine. You sense an unwelcome, exponential trend taking shape.\r\n<\/p><\/blockquote>\r\n<p>I&rsquo;ve run into simpler versions of this problem several times, in different programming languages, and never found a satisfying solution.<\/p>","protected":false},"excerpt":{"rendered":"<p>The documentation for Perl&rsquo;s Maketext module mentions an interesting issue: First off, your code for &ldquo;I scanned %g directory.&rdquo; or &ldquo;I scanned %g directories.&rdquo; assumes there&rsquo;s only singular or plural. But, to use linguistic jargon again, Arabic has grammatical number, like English (but unlike Chinese), but it&rsquo;s a three-term category: singular, dual, and plural. In [&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":[4],"tags":[309],"class_list":["post-1600","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-localization"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/1600","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=1600"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/1600\/revisions"}],"predecessor-version":[{"id":20441,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/1600\/revisions\/20441"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=1600"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=1600"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=1600"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}