

{"id":1196,"date":"2013-07-14T19:45:09","date_gmt":"2013-07-14T18:45:09","guid":{"rendered":"http:\/\/fabsk.eu\/blog\/?p=1196"},"modified":"2013-07-27T14:35:52","modified_gmt":"2013-07-27T13:35:52","slug":"i18n-text-expansion-for-several-languages","status":"publish","type":"post","link":"https:\/\/fabsk.eu\/blog\/2013\/07\/14\/i18n-text-expansion-for-several-languages\/","title":{"rendered":"i18n: text expansion for several languages"},"content":{"rendered":"<p>From the <a href=\"http:\/\/websvn.kde.org\/trunk\/l10n-kde4\/\">KDE translations<\/a>, I compiled <strong><a href=\"http:\/\/fabsk.eu\/i18n\/\">statistics for text expansion<\/a><\/strong>, following the model presented by IBM on <a href=\"http:\/\/www-01.ibm.com\/software\/globalization\/guidelines\/a3.html\">this page<\/a>. So it will tell you for example that if you want to translate a text from English to French, which is between 11 and 20 characters long:<\/p>\n<ul>\n<li>if you want 50% of such texts to fit, you will need 24% of additional space (for an English text of 100 pixels, you will need 124 pixels)<\/li>\n<li>if you want 80%, you will need 57% of space<\/li>\n<li>for 90%: 77%<\/li>\n<li>for 95%: 98%<\/li>\n<li>for 99%: 150%<\/li>\n<\/ul>\n<p>Sources and data are available. Please excuse me for the poor HTML design (written in HTML 5, looks like HTML 1.0 \u263a), I did not put any effort in it (not my cup of tea), but at least it does the job.<\/p>\n<p>I also wrote another version of the generator using the <a href=\"http:\/\/golang.org\/\">Go language<\/a>. I was a little bit disappointed because:<\/p>\n<ul>\n<li>I did not get a formidable boost in performance (I should have, I have a 4-core CPU and Python can not fully take advantage of it because of its <a href=\"https:\/\/en.wikipedia.org\/wiki\/Global_Interpreter_Lock\">GIL<\/a>). In fact, the file parsing part (the most time consuming one) gave similar performance, and the statistic production part was notably faster<\/li>\n<li>The GTK\/Pango (I used to get text length in pixels) binding for Go was incomplete and boring to complete (even if Go has a really nice support to write C bindings). I also had some crashes (related to GObject reference counting).<\/li>\n<li>There is a <a href=\"https:\/\/code.google.com\/p\/freetype-go\/\">port of Freetype<\/a> written in Go, but the code to compute the length of a text was incomplete (it did not cover a given case)<\/li>\n<li>At the time I wrote this version, I thought about integrating Fontconfig directly in the program, but it would have taken more time that I wanted to spend on it.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>From the KDE translations, I compiled statistics for text expansion, following the model presented by IBM on this page. So it will tell you for example that if you want to translate a text from English to French, which is between 11 and 20 characters long: if you want 50% of such texts to fit, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[24,6],"tags":[],"class_list":["post-1196","post","type-post","status-publish","format-standard","hentry","category-dev","category-informatique"],"_links":{"self":[{"href":"https:\/\/fabsk.eu\/blog\/wp-json\/wp\/v2\/posts\/1196","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fabsk.eu\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fabsk.eu\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fabsk.eu\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fabsk.eu\/blog\/wp-json\/wp\/v2\/comments?post=1196"}],"version-history":[{"count":5,"href":"https:\/\/fabsk.eu\/blog\/wp-json\/wp\/v2\/posts\/1196\/revisions"}],"predecessor-version":[{"id":1203,"href":"https:\/\/fabsk.eu\/blog\/wp-json\/wp\/v2\/posts\/1196\/revisions\/1203"}],"wp:attachment":[{"href":"https:\/\/fabsk.eu\/blog\/wp-json\/wp\/v2\/media?parent=1196"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fabsk.eu\/blog\/wp-json\/wp\/v2\/categories?post=1196"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fabsk.eu\/blog\/wp-json\/wp\/v2\/tags?post=1196"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}