{"id":3027,"date":"2015-11-09T16:03:44","date_gmt":"2015-11-09T08:03:44","guid":{"rendered":"http:\/\/blog.qdac.cc\/?p=3027"},"modified":"2015-11-09T16:21:27","modified_gmt":"2015-11-09T08:21:27","slug":"%e6%95%99%e7%a8%8b-qlang-%e5%bf%ab%e9%80%9f%e5%85%a5%e9%97%a8%e6%8c%87%e5%8d%97%ef%bc%9a%e5%a4%9a%e8%af%ad%e8%a8%80%e6%94%af%e6%8c%81%e7%9a%84%e9%ab%98%e7%ba%a7%e5%8a%9f%e8%83%bd","status":"publish","type":"post","link":"https:\/\/blog.qdac.cc\/?p=3027","title":{"rendered":"[\u6559\u7a0b] QLang \u5feb\u901f\u5165\u95e8\u6307\u5357\uff1a\u591a\u8bed\u8a00\u652f\u6301\u7684\u9ad8\u7ea7\u529f\u80fd"},"content":{"rendered":"<p>\u867d\u7136\uff0c\u8bf4\u662f\u9ad8\u7ea7\u7f16\u7a0b\uff0c\u4f46\u5b9e\u9645\u4e0a\u4f9d\u7136\u6ca1\u6709\u591a\u5c11\u9700\u8981\u4f60\u81ea\u5df1\u505a\u7684\u4e8b\u60c5\u3002\u5728\u524d\u8a00\u90e8\u5206\uff0c\u6211\u4eec\u8bf4\u8fc7\uff0cQLang\u00a0\u652f\u6301\u8d44\u6e90\u5b57\u7b26\u4e32\u3001\u5e38\u91cf\u548c\u7ec4\u4ef6\u7684\u975e\u7a7a\u5b57\u7b26\u4e32\u5c5e\u6027\u7684\u7ffb\u8bd1\u652f\u6301\u3002\u81f3\u4e8e\u8d44\u6e90\u5b57\u7b26\u4e32\u600e\u4e48\u52a0\u5165\u7684\u95ee\u9898\uff0c\u54b1\u5728\u8fd9\u91cc\u4e0d\u518d\u7f00\u8ff0\uff0c\u53c2\u8003\u00a0Delphi\/C++\u00a0Builder\u00a0\u5e2e\u52a9\u4e2d\u5173\u4e8e\u00a0resource\u00a0strings\u00a0\u7684\u8bf4\u660e\u3002<\/p>\n<p><b>\u3010\u5e38\u91cf\u5b57\u7b26\u4e32\u3011<\/b><\/p>\n<p>\u73b0\u5728\u6211\u4eec\u8bf4\u8bf4\u5e38\u91cf\u5b57\u7b26\u4e32\uff0c\u5982\u4e0b\u9762\u7684\u4ee3\u7801\uff1a<\/p>\n<pre class=\"lang:delphi decode:true \">ShowMessage('Hello,world');<\/pre>\n<p>\u5176\u4e2d\u7684\u00a0Hello,world\u00a0\u5c31\u662f\u4e00\u4e2a\u5e38\u91cf\u5b57\u7b26\u4e32\uff0c\u90a3\u4e48\u5728\u4f7f\u7528\u00a0QLang\u00a0\u540e\uff0c\u4e0a\u9762\u7684\u4ee3\u7801\u5e94\u8be5\u505a\u4e00\u70b9\u70b9\u6539\u52a8\uff1a<\/p>\n<pre class=\"lang:delphi decode:true \">ShowMessage(_('Hello,world'));<\/pre>\n<p>\u552f\u4e00\u7684\u533a\u522b\u662f\u5c06\u5e38\u91cf\u5b57\u7b26\u4e32\u7528\u00a0_()\u00a0\u51fd\u6570\u5305\u542b\u8d77\u6765\uff0c\u8fd9\u6837\u5b50\uff0c\u7f16\u8f91\u5668\u5c31\u53ef\u4ee5\u81ea\u52a8\u626b\u63cf\u5e76\u8bc6\u867d\u9700\u8981\u7ffb\u8bd1\u7684\u5e38\u91cf\u5b57\u7b26\u4e32\u4e86\u3002\u5f53\u7136\u4e86\uff0c\u5982\u679c\u662f\u4e0d\u9700\u8981\u7ffb\u8bd1\u7684\u5e38\u91cf\u5b57\u7b26\u4e32\uff0c\u4e5f\u5c31\u5343\u4e07\u4e0d\u8981\u6539\u6210\u8fd9\u4e2a\u6837\u5b50\u3002<\/p>\n<p><b>\u3010\u7ec4\u4ef6\u3011<\/b><\/p>\n<p>\u81f3\u4e8e\u7ec4\u4ef6\u7684\u5b57\u7b26\u4e32\u5c5e\u6027\uff0c\u6211\u4eec\u9700\u8981\u6ce8\u610f\u67d0\u4e9b\u7279\u6b8a\u7684\u7ec4\u4ef6\uff0c\u5b83\u4fdd\u5b58\u5728\u00a0DFM\u00a0\u6587\u4ef6\u4e2d\u7684\u5b57\u7b26\u4e32\u5c5e\u6027\u540d\u79f0\u548c\u5728\u5bf9\u8c61\u89c2\u5bdf\u5668\uff08Object\u00a0Inspector\uff09\u4e2d\u663e\u793a\u7684\u540d\u79f0\u5e76\u4e0d\u4e00\u81f4\uff0c\u5bf9\u4e8e\u7cfb\u7edf\u9ed8\u8ba4\u6ca1\u6709\u652f\u6301\u7684\u7ec4\u4ef6\uff0c\u60a8\u53ef\u4ee5\uff1a<\/p>\n<ul>\n<li>\u5c06\u7ec4\u4ef6\u53d1\u7ed9\u6211\u4e00\u4efd\uff0c\u6211\u4e3a\u60a8\u5728\u591a\u8bed\u8a00\u7f16\u8f91\u5668\u4e2d\u589e\u52a0\u5bf9\u5e94\u7684\u652f\u6301\uff1b<\/li>\n<li>\u81ea\u5df1\u4fee\u6539\u591a\u8bed\u8a00\u7f16\u8bd1\u5668\u6e90\u7801\uff0c\u589e\u52a0\u76f8\u5173\u7684\u652f\u6301\uff1b<\/li>\n<li>\u624b\u52a8\u4fee\u6539\u751f\u6210\u7684\u00a0QLang\u00a0\u6587\u4ef6\uff0c\u5c06\u5176\u8f6c\u6362\u4e3a\u6b63\u786e\u7684\u5c5e\u6027\u540d\u79f0\u3002<\/li>\n<\/ul>\n<p><b>\u3010\u54cd\u5e94\u8bed\u8a00\u5207\u6362\u4e8b\u4ef6\u3011<\/b><\/p>\n<p><b>\u00a0<\/b>\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u6211\u4eec\u9700\u8981\u5728\u7528\u6237\u9009\u62e9\u4e0d\u540c\u7684\u8bed\u8a00\u65f6\uff0c\u505a\u51fa\u67d0\u4e9b\u54cd\u5e94\u3002\u6bd4\u5982\uff0c\u6211\u4eec\u7f13\u5b58\u4e86\u67d0\u4e2a\u5b57\u7b26\u4e32\u7684\u5e38\u91cf\u7684\u503c\uff0c\u5982\u679c\u7528\u6237\u53d8\u66f4\u4e86\u8bed\u8a00\uff0c\u6211\u4eec\u5c31\u9700\u8981\u91cd\u65b0\u7f13\u5b58\uff0c\u8fd9\u65f6\u6211\u4eec\u5c31\u9700\u8981\u54cd\u5e94\u7528\u6237\u8bed\u8a00\u4e8b\u4ef6\u7684\u4e8b\u4ef6\u4e86\u3002<\/p>\n<p>\u5728\u9700\u8981\u54cd\u5e94\u65f6\uff0c\u6211\u4eec\u901a\u8fc7\u8c03\u7528\u00a0LangManager.AddListener\u00a0\u6765\u6dfb\u52a0\u4e00\u4e2a\u54cd\u5e94\u51fd\u6570\uff0c\u5728\u4e0d\u9700\u8981\u518d\u54cd\u5e94\u65f6\uff0c\u53ea\u9700\u8981\u8c03\u7528\u00a0LangManager.RemoveListener\u00a0\u79fb\u9664\u8fd9\u4e2a\u54cd\u5e94\u51fd\u6570\u5373\u53ef\u3002<\/p>\n<p><b>\u3010\u5176\u5b83\u3011<\/b><\/p>\n<p>\u5982\u679c\u60a8\u6709\u5565\u7279\u6b8a\u7684\u9700\u8981\uff0c\u6b22\u8fce\u8fdb\u5165\u00a0QLang\u00a0\u7684\u5b98\u65b9\u7fa4\u6765\u8ba8\u8bba\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u867d\u7136\uff0c\u8bf4\u662f\u9ad8\u7ea7\u7f16\u7a0b\uff0c\u4f46\u5b9e\u9645\u4e0a\u4f9d\u7136\u6ca1\u6709\u591a\u5c11 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[69,8,9,464],"tags":[57],"class_list":["post-3027","post","type-post","status-publish","format-standard","hentry","category-c-builder","category-delphi","category-qdac","category-qlang","tag-57"],"views":4589,"_links":{"self":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/3027","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3027"}],"version-history":[{"count":2,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/3027\/revisions"}],"predecessor-version":[{"id":3029,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/3027\/revisions\/3029"}],"wp:attachment":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3027"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3027"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3027"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}