[gtkmm-documentation: 22/31] translate appendix A.
- From: Kjell Ahlstedt <kjellahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkmm-documentation: 22/31] translate appendix A.
- Date: Tue, 12 Jan 2021 15:40:35 +0000 (UTC)
commit d913088df298f99f319faf366f9a9c322d18c482
Author: CCTV-1 <script tar gz gmail com>
Date: Fri Jan 8 12:13:02 2021 +0800
translate appendix A.
docs/tutorial/zh_CN/zh_CN.po | 82 +++++++++++++++++++++++++++++++++++++++-----
1 file changed, 74 insertions(+), 8 deletions(-)
---
diff --git a/docs/tutorial/zh_CN/zh_CN.po b/docs/tutorial/zh_CN/zh_CN.po
index a894131..adbd623 100644
--- a/docs/tutorial/zh_CN/zh_CN.po
+++ b/docs/tutorial/zh_CN/zh_CN.po
@@ -13524,7 +13524,7 @@ msgstr ""
#: C/index-in.docbook:7954
msgid "The RefPtr smartpointer"
-msgstr ""
+msgstr "RefPtr智能指针"
#: C/index-in.docbook:7955
msgid ""
@@ -13537,21 +13537,35 @@ msgid ""
"<classname>Glib::RefPtr<></classname> was introduced long before there "
"was a reference-counting smartpointer in the C++ Standard Library."
msgstr ""
+"<classname>Glib::RefPtr</classname>是一个智能指针。准确的说,它是一个引用计数"
+"æ™ºèƒ½æŒ‡é’ˆã€‚ä½ å¯èƒ½å¯¹<classname>std::unique_ptr<></classname>å’Œ"
+"<classname>std::shared_ptr<></classname>å分熟悉,它们也是智能指针。在"
+"<application>gtkmm</application>-4.0ä¸<classname>Glib::RefPtr<></"
+"classname>是<classname>std::shared_ptr<></classname>的别å。<classname>Glib::"
+"RefPtr<></classname>在C++æ ‡å‡†åº“è¿˜æ²¡æœ‰æ·»åŠ å¼•ç”¨è®¡æ•°æ™ºèƒ½æŒ‡é’ˆçš„æ—¶å€™å°±å·²ç»å˜"
+"在于<application>glibmm</application>了(译注:事实上Glib::RefPtr的行为与"
+"std::shared_ptr的行为并ä¸å®Œå…¨ä¸€è‡´ï¼Œä¸”å› glibmmç‰åº“的文档是由C文档直接生æˆè€Œ"
+"æ¥ï¼Œåœ¨ä¸€äº›C库ä¸å¯ä»¥æŽ¥å—NULL作为å‚数的函数在对应的C++绑定库ä¸çš„文档ä¸éƒ½æ˜¯å¯ä»¥"
+"接å—nullptr作为å‚数,但实际上并ä¸ä¸€å®šèƒ½æŽ¥å—nullptr作为å‚数,有时候需è¦ä¼ 递"
+"Glib::RefPtr<FOO>()ã€Gdk::Event()ã€ç©ºçš„å—符串ç‰ã€‚å‚è§ï¼š<ulink url=\"https://";
+"gitlab.gnome.org/GNOME/glibmm/-/issues/24\">问题24</ulink>)。"
#: C/index-in.docbook:7966
msgid ""
"<ulink url=\"http://developer.gnome.org/glibmm/unstable/classGlib_1_1RefPtr.";
"html\">Reference</ulink>"
msgstr ""
+"<ulink url=\"http://developer.gnome.org/glibmm/unstable/classGlib_1_1RefPtr.";
+"html\">å‚考</ulink>"
#: C/index-in.docbook:7968
msgid ""
"A smartpointer acts much like a normal pointer. Here are a few examples."
-msgstr ""
+msgstr "智能指针的行为很åƒæ™®é€šæŒ‡é’ˆã€‚è¿™é‡Œæœ‰å‡ ä¸ªä¾‹å。"
#: C/index-in.docbook:7971
msgid "Copying"
-msgstr ""
+msgstr "å¤åˆ¶"
#: C/index-in.docbook:7972
msgid ""
@@ -13559,6 +13573,8 @@ msgid ""
"unlike normal pointers, you don't need to worry about deleting the "
"underlying instance."
msgstr ""
+"ä½ å¯ä»¥åƒå¤åˆ¶æ™®é€šæŒ‡é’ˆä¸€æ ·å¤åˆ¶<classname>RefPtr</classname>ï¼Œä½ ä¸éœ€è¦æ‹…å¿ƒåˆ é™¤åº•"
+"层实例。"
#: C/index-in.docbook:7978
#, no-wrap
@@ -13567,6 +13583,9 @@ msgid ""
"auto refPixbuf = Gdk::Pixbuf::create_from_file(filename);\n"
"auto refPixbuf2 = refPixbuf;\n"
msgstr ""
+"\n"
+"auto refPixbuf = Gdk::Pixbuf::create_from_file(filename);\n"
+"auto refPixbuf2 = refPixbuf;\n"
#: C/index-in.docbook:7983
msgid ""
@@ -13574,6 +13593,8 @@ msgid ""
"standard containers, such as <classname>std::vector</classname> or "
"<classname>std::list</classname>."
msgstr ""
+"è¿™æ„味ç€ä½ å¯ä»¥å°†<classname>RefPtr</classname>储å˜äºŽæ ‡å‡†å®¹å™¨ä¸ï¼Œä¾‹å¦‚:"
+"<classname>std::vector</classname>或<classname>std::list</classname>。"
#: C/index-in.docbook:7988
#, no-wrap
@@ -13583,16 +13604,21 @@ msgid ""
"auto refPixbuf = Gdk::Pixbuf::create_from_file(filename);\n"
"listPixbufs.push_back(refPixbuf);\n"
msgstr ""
+"\n"
+"std::list<Glib::RefPtr<Gdk::Pixbuf>> listPixbufs;\n"
+"auto refPixbuf = Gdk::Pixbuf::create_from_file(filename);\n"
+"listPixbufs.push_back(refPixbuf);\n"
#: C/index-in.docbook:7996
msgid "Dereferencing"
-msgstr ""
+msgstr "解引用"
#: C/index-in.docbook:7997
msgid ""
"You can dereference a smartpointer with the -> operator, to call the "
"methods of the underlying instance, just like a normal pointer."
msgstr ""
+"ä½ å¯ä»¥ä½¿ç”¨->æ“作符解引用智能指针,就åƒä½¿ç”¨æ™®é€šæŒ‡é’ˆè®¿é—®åº•å±‚å®žä¾‹çš„æ–¹æ³•ä¸€æ ·ã€‚"
#: C/index-in.docbook:8001
#, no-wrap
@@ -13601,6 +13627,9 @@ msgid ""
"auto refPixbuf = Gdk::Pixbuf::create_from_file(filename);\n"
"auto width = refPixbuf->get_width();\n"
msgstr ""
+"\n"
+"auto refPixbuf = Gdk::Pixbuf::create_from_file(filename);\n"
+"auto width = refPixbuf->get_width();\n"
#: C/index-in.docbook:8006
msgid ""
@@ -13609,6 +13638,9 @@ msgid ""
"so. Unless you are careful, you can end up with a pointer or a reference "
"which is not included in the reference count."
msgstr ""
+"ä½ è¿˜å¯ä»¥ä½¿ç”¨*æ“作符和<methodname>get()</methodname>方法访问底层实例,ä¸è¿‡é€šå¸¸"
+"è¿™ä¸æ˜¯ä¸€ä¸ªå¥½ä¸»æ„。除éžä½ éžå¸¸çš„谨慎没有犯错,å¦åˆ™ä½ 将得到一个ä¸å˜åœ¨äºŽå¼•ç”¨è®¡æ•°"
+"ä¸çš„指å‘底层实例的指针或底层实例的引用。"
#: C/index-in.docbook:8012
#, no-wrap
@@ -13617,16 +13649,21 @@ msgid ""
"auto refPixbuf = Gdk::Pixbuf::create_from_file(filename);\n"
"auto& underlying = *refPixbuf; // Possible, but not recommended\n"
msgstr ""
+"\n"
+"auto refPixbuf = Gdk::Pixbuf::create_from_file(filename);\n"
+"auto& underlying = *refPixbuf; // Possible, but not recommended\n"
#: C/index-in.docbook:8019
msgid "Casting"
-msgstr ""
+msgstr "类型转æ¢"
#: C/index-in.docbook:8020
msgid ""
"You can cast <classname>RefPtr</classname>s to base types, just like normal "
"pointers."
msgstr ""
+"ä½ å¯ä»¥åƒå¯¹æ£å¸¸æŒ‡é’ˆè¿›è¡Œç±»åž‹è½¬æ¢ä¸€æ ·ï¼Œå°†<classname>RefPtr</classname>转æ¢åˆ°åŸºç¡€"
+"类型。"
#: C/index-in.docbook:8025
#, no-wrap
@@ -13635,6 +13672,9 @@ msgid ""
"auto refStore = Gtk::TreeStore::create(columns);\n"
"Glib::RefPtr<Gtk::TreeModel> refModel = refStore;\n"
msgstr ""
+"\n"
+"auto refStore = Gtk::TreeStore::create(columns);\n"
+"Glib::RefPtr<Gtk::TreeModel> refModel = refStore;\n"
#: C/index-in.docbook:8030
msgid ""
@@ -13643,12 +13683,15 @@ msgid ""
"RefPtr<DerivedType>&</type>. The cast is implicit, just as it "
"would be for a normal pointer."
msgstr ""
+"è¿™æ„味ç€ä»»ä½•æŽ¥å—<type>const Glib::RefPtr<BaseType>&</type>å‚数的函"
+"数也能接å—<type>const Glib::RefPtr<DerivedType>&</type>对象。æ¤è½¬æ¢"
+"å’Œæ™®é€šæŒ‡é’ˆä¸€æ ·æ˜¯éšå¼çš„。"
#: C/index-in.docbook:8034
msgid ""
"You can also cast to a derived type, but the syntax is a little different "
"than with a normal pointer."
-msgstr ""
+msgstr "ä½ è¿˜å¯ä»¥å°†å…¶è½¬æ¢ä¸ºæ´¾ç”Ÿç±»åž‹ï¼Œä½†æ˜¯è¯æ³•å’Œæ™®é€šæŒ‡é’ˆçš„è¯æ³•ç•¥æœ‰ä¸åŒã€‚"
#: C/index-in.docbook:8038
#, no-wrap
@@ -13657,16 +13700,20 @@ msgid ""
"auto refStore = std::dynamic_pointer_cast<Gtk::TreeStore>(refModel);\n"
"auto refStore2 = std::static_pointer_cast<Gtk::TreeStore>(refModel);\n"
msgstr ""
+"\n"
+"auto refStore = std::dynamic_pointer_cast<Gtk::TreeStore>(refModel);\n"
+"auto refStore2 = std::static_pointer_cast<Gtk::TreeStore>(refModel);\n"
#: C/index-in.docbook:8045
msgid "Checking for nullptr"
-msgstr ""
+msgstr "nullptr检查"
#: C/index-in.docbook:8046
msgid ""
"Just like normal pointers, you can check whether a <classname>RefPtr</"
"classname> points to anything."
msgstr ""
+"å°±åƒæ™®é€šæŒ‡é’ˆä¸€æ ·ï¼Œä½ å¯ä»¥æ£€æŸ¥<classname>RefPtr</classname>是å¦æŒ‡å‘了任何东西。"
#: C/index-in.docbook:8051
#, no-wrap
@@ -13679,6 +13726,13 @@ msgid ""
" ...\n"
"}\n"
msgstr ""
+"\n"
+"auto refModel = m_TreeView.get_model();\n"
+"if (refModel)\n"
+"{\n"
+" auto cols_count = refModel->get_n_columns();\n"
+" ...\n"
+"}\n"
#: C/index-in.docbook:8060
msgid ""
@@ -13686,10 +13740,12 @@ msgid ""
"initialized to <literal>nullptr</literal> so you don't need to remember to "
"do that yourself."
msgstr ""
+"和普通指针ä¸ä¸€æ ·çš„是,<classname>RefPtr</classname>将会自动åˆå§‹åŒ–为"
+"<literal>nullptr</literal>,ä¸éœ€è¦ä½ 自己进行置空。"
#: C/index-in.docbook:8066
msgid "Constness"
-msgstr ""
+msgstr "常数"
#: C/index-in.docbook:8067
msgid ""
@@ -13698,6 +13754,9 @@ msgid ""
"to a <type>const Something</type>. The pointer can be changed, but not the "
"<type>Something</type> that it points to."
msgstr ""
+"在C++ä¸<literal>const</literal>关键å—的使用并ä¸æ€»æ˜¯å¾ˆæ¸…æ™°ã€‚ä½ å¯èƒ½æ²¡æœ‰æ„识到"
+"<type>const Something*</type>声明了一个指å‘<type>const Something</type>的指"
+"针。这个指针的指å‘是å¯ä»¥è¢«æ”¹å˜çš„,其指å‘çš„<type>Something</type>ä¸èƒ½è¢«æ”¹å˜ã€‚"
#: C/index-in.docbook:8073
msgid ""
@@ -13706,6 +13765,10 @@ msgid ""
"&</type>, and the equivalent of <type>const Something*</type> is "
"<type>const Glib::RefPtr<const Something>&</type>."
msgstr ""
+"å› æ¤ï¼Œåœ¨æ–¹æ³•å‚æ•°ä¸ä¸Ž<type>Something*</type>ç‰æ•ˆçš„<classname>RefPtr</"
+"classname>是<type>const Glib::RefPtr<Something>&</type>,而与"
+"<type>const Something*</type>ç‰æ•ˆçš„是<type>const Glib::RefPtr<const "
+"Something>&</type>。"
#: C/index-in.docbook:8080
msgid ""
@@ -13714,6 +13777,9 @@ msgid ""
"<classname>std::string</classname> for a method parameter to avoid "
"unnecessary copying."
msgstr ""
+"用<literal>const ... &</literal>包围是处于效率考虑,就åƒåœ¨æ–¹æ³•å‚æ•°ä¸ä½¿ç”¨"
+"<classname>const std::string&</classname>而ä¸æ˜¯ç”¨<classname>std::string</"
+"classname>ä¸€æ ·ï¼Œè¿™æ˜¯ä¸ºäº†é¿å…ä¸å¿…è¦çš„å¤åˆ¶ã€‚"
#: C/index-in.docbook:8095
msgid "Connecting signal handlers"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]