{"id":3777,"date":"2019-07-06T03:07:44","date_gmt":"2019-07-06T00:07:44","guid":{"rendered":"https:\/\/sitecenneti.com\/wordpress\/?p=3777"},"modified":"2019-07-12T02:25:36","modified_gmt":"2019-07-11T23:25:36","slug":"_nx","status":"publish","type":"post","link":"https:\/\/sitecenneti.com\/wordpress\/wordpress-fonksiyonlari\/_nx\/","title":{"rendered":"_nx()"},"content":{"rendered":"<div id=\"toc_container\" class=\"toc_transparent no_bullets\"><p class=\"toc_title\">BU DERS\u0130N BA\u015eLIKLARI<\/p><ul class=\"toc_list\"><li><a href=\"#Aciklamasi\"><span class=\"toc_number toc_depth_1\">1<\/span> A\u00e7\u0131klamas\u0131:<\/a><\/li><li><a href=\"#Parametreleri\"><span class=\"toc_number toc_depth_1\">2<\/span> Parametreleri:<\/a><ul><li><a href=\"#tekil\"><span class=\"toc_number toc_depth_2\">2.1<\/span> $tekil<\/a><\/li><li><a href=\"#cogul\"><span class=\"toc_number toc_depth_2\">2.2<\/span> $\u00e7o\u011ful<\/a><\/li><li><a href=\"#sayisi\"><span class=\"toc_number toc_depth_2\">2.3<\/span> $say\u0131s\u0131<\/a><\/li><li><a href=\"#anlam_ipucu\"><span class=\"toc_number toc_depth_2\">2.4<\/span> $anlam_ipucu<\/a><\/li><li><a href=\"#textdomain\"><span class=\"toc_number toc_depth_2\">2.5<\/span> $textdomain<\/a><\/li><\/ul><\/li><li><a href=\"#Dondurdugu_deger\"><span class=\"toc_number toc_depth_1\">3<\/span> D\u00f6nd\u00fcrd\u00fc\u011f\u00fc de\u011fer:<\/a><\/li><li><a href=\"#Kaynak_kodu\"><span class=\"toc_number toc_depth_1\">4<\/span> Kaynak kodu:<\/a><\/li><li><a href=\"#Kullanimi\"><span class=\"toc_number toc_depth_1\">5<\/span> Kullan\u0131m\u0131:<\/a><ul><li><a href=\"#Ornek-1\"><span class=\"toc_number toc_depth_2\">5.1<\/span> \u00d6rnek-1<\/a><\/li><\/ul><\/li><\/ul><\/div>\n\n<pre class=\"wp-block-code\"><code>_nx( string $tekil, string $\u00e7o\u011ful, int $say\u0131s\u0131, string $anlam_ipucu, string $textdomain = 'default' );<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span id=\"Aciklamasi\">A\u00e7\u0131klamas\u0131:<\/span><\/h2>\n\n\n\n<p><code>_nx()<\/code> fonksiyonu asl\u0131nda, <a rel=\"noreferrer noopener\" aria-label=\"_x() (yeni sekmede a\u00e7\u0131l\u0131r)\" href=\"https:\/\/sitecenneti.com\/wordpress\/wordpress-fonksiyonlari\/_x\/\" target=\"_blank\">_x()<\/a> fonksiyonu ile <a rel=\"noreferrer noopener\" aria-label=\"_n() (yeni sekmede a\u00e7\u0131l\u0131r)\" href=\"https:\/\/sitecenneti.com\/wordpress\/wordpress-fonksiyonlari\/_n\/\" target=\"_blank\">_n()<\/a> fonksiyonunun melezidir. Fonksiyon, tekil ve \u00e7o\u011ful yaz\u0131l\u0131\u015flar\u0131 farkl\u0131 olan kelimeleri terc\u00fcmeye haz\u0131rlar. \u00d6rnek olarak, \u0130ngilizce dilinde, kelimelerin tekil ve \u00e7o\u011ful yaz\u0131l\u0131\u015f\u0131 farkl\u0131d\u0131r. Bu y\u00fczden tekil ve \u00e7o\u011ful kelimeleri terc\u00fcmeye haz\u0131rlamak i\u00e7in <code>_n()<\/code> fonksiyonu kullan\u0131l\u0131r. E\u011fer, bir kelimenin tekil ve \u00e7o\u011ful yaz\u0131m\u0131 farkl\u0131 durumlarda farkl\u0131 anlamlar i\u00e7eriyorsa o zaman bu kelimeyi terc\u00fcmeye haz\u0131rlamak i\u00e7in <code>_nx()<\/code> fonksiyonuna ihtiyac\u0131m\u0131z var demektir.<\/p>\n\n\n\n<p>Yukar\u0131da bahsetti\u011fimiz durum, T\u00fcrk\u00e7e dili i\u00e7in, \u00e7ok da s\u0131k kar\u015f\u0131la\u015ft\u0131\u011f\u0131m\u0131z bir durum olmad\u0131\u011f\u0131 i\u00e7in, fonksiyon bize biraz karma\u015f\u0131k gelebilir.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span id=\"Parametreleri\">Parametreleri:<\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><span id=\"tekil\">$tekil<\/span><\/h3>\n\n\n\n<p>(<em>Zorunludur<\/em>.) Bir b\u00fcy\u00fckl\u00fc\u011f\u00fcn, say\u0131s\u0131 1 oldu\u011fu zamanki yaz\u0131m\u0131d\u0131r.<\/p>\n\n\n\n<p><strong>\u00d6rnek<\/strong>: \u201cComment\u201d (yorum)<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span id=\"cogul\">$\u00e7o\u011ful<\/span><\/h3>\n\n\n\n<p>(<em>Zorunludur<\/em>.) Bir b\u00fcy\u00fckl\u00fc\u011f\u00fcn, say\u0131s\u0131 1 den \u00e7ok az oldu\u011fu zamanki yaz\u0131m\u0131d\u0131r.<\/p>\n\n\n\n<p><strong>\u00d6rnek<\/strong>: \u201cComments\u201d (yorumlar)<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span id=\"sayisi\">$say\u0131s\u0131<\/span><\/h3>\n\n\n\n<p>(<em>int<\/em> &#8211; <em>Zorunludur<\/em>.) B\u00fcy\u00fckl\u00fc\u011f\u00fcn say\u0131s\u0131d\u0131r.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span id=\"anlam_ipucu\">$anlam_ipucu<\/span><\/h3>\n\n\n\n<p>(<em>Zorunludur<\/em>.) Kelimenin belli bir anlam\u0131 i\u00e7in ipucu niteli\u011finde bir texttir. Yani, kelimenin hangi anlam\u0131n\u0131 kulland\u0131\u011f\u0131m\u0131z\u0131 anlamak i\u00e7in, hat\u0131rlat\u0131c\u0131 bir kelime ya da ifadedir.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span id=\"textdomain\">$textdomain<\/span><\/h3>\n\n\n\n<p>Her teman\u0131n, di\u011fer temalardan farkl\u0131 bir textdomain de\u011feri vard\u0131r. Textdomainler, WordPress\u2019in, tema ya da eklentiye \u00f6zg\u00fc terc\u00fcmeleri saptayabilmesini sa\u011flar, farkl\u0131 temalar\u0131n ya da eklentilerin terc\u00fcmelerinin birbirine kar\u0131\u015fmas\u0131n\u0131 engeller.<\/p>\n\n\n\n<p>Varsay\u0131lan de\u011feri&nbsp;<code>'default'<\/code>&nbsp;olarak ayarlanm\u0131\u015ft\u0131r.<\/p>\n\n\n\n<p>Teman\u0131za \u00f6zel bir <code>$textdomain<\/code>&nbsp;de\u011feri olu\u015fturmay\u0131 \u00f6\u011frenmek i\u00e7in,&nbsp;<a rel=\"noreferrer noopener\" href=\"https:\/\/sitecenneti.com\/wordpress\/wordpress-tema-yapimi\/4-17-temayi-tercumeye-hazirlama-internationalization\/#8220Textdomain8221_Parametresi\" target=\"_blank\">Textdomain Parametresi<\/a>&nbsp;ba\u015fl\u0131\u011f\u0131m\u0131z\u0131 okuyabilirsiniz.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span id=\"Dondurdugu_deger\">D\u00f6nd\u00fcrd\u00fc\u011f\u00fc de\u011fer:<\/span><\/h2>\n\n\n\n<p>Tekil veya \u00e7o\u011ful bi\u00e7imleriyle, terc\u00fcme edilmi\u015f bir kelime veya ifade d\u00f6nd\u00fcr\u00fcr.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span id=\"Kaynak_kodu\">Kaynak kodu:<\/span><\/h2>\n\n\n\n<p>Dizini : <strong>wp-includes\/l10n.php<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>function _nx( $single, $plural, $number, $context, $domain = 'default' ) {\n    $translations = get_translations_for_domain( $domain );\n    $translation  = $translations->translate_plural( $single, $plural, $number, $context );\n \n    \/**\n     * Filters the singular or plural form of a string with gettext context.\n     *\n     * @since 2.8.0\n     *\n     * @param string $translation Translated text.\n     * @param string $single      The text to be used if the number is singular.\n     * @param string $plural      The text to be used if the number is plural.\n     * @param string $number      The number to compare against to use either the singular or plural form.\n     * @param string $context     Context information for the translators.\n     * @param string $domain      Text domain. Unique identifier for retrieving translated strings.\n     *\/\n    return apply_filters( 'ngettext_with_context', $translation, $single, $plural, $number, $context, $domain );\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span id=\"Kullanimi\">Kullan\u0131m\u0131:<\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><span id=\"Ornek-1\">\u00d6rnek-1<\/span><\/h3>\n\n\n\n<p>A\u015fa\u011f\u0131daki kod ile, &#8220;<em>group<\/em>&#8221; kelimesinin, insan (<em>people<\/em>)  ve hayvan (<em>animal<\/em>) topluluklar\u0131 i\u00e7in, tekil ve \u00e7o\u011ful \u015fekilleri, ayr\u0131 ayr\u0131 terc\u00fcme edilebilecek \u015fekilde olu\u015fturulmu\u015ftur.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>printf( _nx( '%s group', '%s groups', $people, 'group of people', 'textdomain' ), number_format_i18n( $people ) );\nprintf( _nx( '%s group', '%s groups', $animals, 'group of animals', 'textdomain' ), number_format_i18n( $animals ) );\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Haz\u0131r bir WordPress fonksiyonu olan _nx() fonksiyonu a\u00e7\u0131klanm\u0131\u015ft\u0131r.<\/p>\n","protected":false},"author":1,"featured_media":3103,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[29],"tags":[177],"class_list":["post-3777","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wordpress-fonksiyonlari","tag-_nx"],"_links":{"self":[{"href":"https:\/\/sitecenneti.com\/wordpress\/wp-json\/wp\/v2\/posts\/3777","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sitecenneti.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sitecenneti.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sitecenneti.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sitecenneti.com\/wordpress\/wp-json\/wp\/v2\/comments?post=3777"}],"version-history":[{"count":0,"href":"https:\/\/sitecenneti.com\/wordpress\/wp-json\/wp\/v2\/posts\/3777\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sitecenneti.com\/wordpress\/wp-json\/wp\/v2\/media\/3103"}],"wp:attachment":[{"href":"https:\/\/sitecenneti.com\/wordpress\/wp-json\/wp\/v2\/media?parent=3777"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sitecenneti.com\/wordpress\/wp-json\/wp\/v2\/categories?post=3777"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sitecenneti.com\/wordpress\/wp-json\/wp\/v2\/tags?post=3777"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}