From 610b6612801817b7806ae48d54d9ec108001805a Mon Sep 17 00:00:00 2001 From: Burak Date: Thu, 28 Sep 2023 03:37:49 +0300 Subject: [PATCH 1/4] Cached translation support for LibraryTypes and TagTypes. --- src/Configuration.php | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/Configuration.php b/src/Configuration.php index 5d69c23..7e7c45e 100644 --- a/src/Configuration.php +++ b/src/Configuration.php @@ -259,9 +259,16 @@ public function libraryTypes(array $types): static return $this; } + private ?array $translatedLibraryTypes = null; + public function getLibraryTypes(): ?array { - return $this->libraryTypes; + if ($this->translatedLibraryTypes === null && $this->libraryTypes) + { + $this->translatedLibraryTypes = array_map('__', $this->libraryTypes); + } + + return $this->translatedLibraryTypes; } public function tagTypes(array $types): static @@ -271,9 +278,16 @@ public function tagTypes(array $types): static return $this; } + private ?array $translatedTagTypes = null; + public function getTagTypes(): ?array { - return $this->tagTypes; + if ($this->translatedTagTypes === null && $this->tagTypes) + { + $this->translatedTagTypes = array_map('__', $this->tagTypes); + } + + return $this->translatedTagTypes; } public function uriPrefix(array $prefix): static From f4acdae3bfde6635ac9fd9a32942343397813841 Mon Sep 17 00:00:00 2001 From: Burak Date: Thu, 28 Sep 2023 03:41:50 +0300 Subject: [PATCH 2/4] Cached translation support for LibraryTypes and TagTypes. pint --- src/Configuration.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Configuration.php b/src/Configuration.php index 7e7c45e..4da6c7b 100644 --- a/src/Configuration.php +++ b/src/Configuration.php @@ -263,8 +263,7 @@ public function libraryTypes(array $types): static public function getLibraryTypes(): ?array { - if ($this->translatedLibraryTypes === null && $this->libraryTypes) - { + if ($this->translatedLibraryTypes === null && $this->libraryTypes) { $this->translatedLibraryTypes = array_map('__', $this->libraryTypes); } @@ -282,8 +281,7 @@ public function tagTypes(array $types): static public function getTagTypes(): ?array { - if ($this->translatedTagTypes === null && $this->tagTypes) - { + if ($this->translatedTagTypes === null && $this->tagTypes) { $this->translatedTagTypes = array_map('__', $this->tagTypes); } From 25141804cb3aaed6dfe345aa9ef63bd8641bdfcf Mon Sep 17 00:00:00 2001 From: Burak Date: Thu, 28 Sep 2023 03:51:11 +0300 Subject: [PATCH 3/4] Cached translation support for LibraryTypes and TagTypes. extra checks added --- src/Configuration.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Configuration.php b/src/Configuration.php index 4da6c7b..55b54b6 100644 --- a/src/Configuration.php +++ b/src/Configuration.php @@ -263,11 +263,11 @@ public function libraryTypes(array $types): static public function getLibraryTypes(): ?array { - if ($this->translatedLibraryTypes === null && $this->libraryTypes) { + if ($this->translatedLibraryTypes === null && $this->libraryTypes && function_exists('__')) { $this->translatedLibraryTypes = array_map('__', $this->libraryTypes); } - return $this->translatedLibraryTypes; + return $this->translatedLibraryTypes ?? $this->libraryTypes; } public function tagTypes(array $types): static @@ -281,11 +281,11 @@ public function tagTypes(array $types): static public function getTagTypes(): ?array { - if ($this->translatedTagTypes === null && $this->tagTypes) { + if ($this->translatedTagTypes === null && $this->tagTypes && function_exists('__')) { $this->translatedTagTypes = array_map('__', $this->tagTypes); } - return $this->translatedTagTypes; + return $this->translatedTagTypes ?? $this->tagTypes; } public function uriPrefix(array $prefix): static From a94500162204e5175a027b4b1ea5fd7fbe9610e9 Mon Sep 17 00:00:00 2001 From: Burak Date: Thu, 28 Sep 2023 03:57:40 +0300 Subject: [PATCH 4/4] added Turkish language translations. --- resources/lang/tr.json | 101 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 resources/lang/tr.json diff --git a/resources/lang/tr.json b/resources/lang/tr.json new file mode 100644 index 0000000..f868179 --- /dev/null +++ b/resources/lang/tr.json @@ -0,0 +1,101 @@ +{ + "Posts": "Yazılar", + "Post": "Yazı", + "CMS": "İçerik Yönetim Sistemi", + "Tag": "Etiket", + "Tags": "Etiketler", + "publish": "yayınla", + "Title": "Başlık", + "Title & Content": "Başlık & İçerik", + "Content": "İçerik", + "Status": "Durum", + "Post Tags": "Yazı Etiketleri", + "Post Category": "Yazı Kategorisi", + "Password Protected": "Şifre Korumalı", + "Sticky Until": "Sabitlenmiş Son Tarih", + "Still Sticky": "Hâlâ Sabit", + "Sticky Only": "Sadece Sabit", + "Not Sticky": "Sabit Değil", + "Publish": "Yayınla", + "Future": "Gelecek", + "Draft": "Taslak", + "Auto draft": "Otomatik Taslak", + "Pending": "Beklemede", + "Private": "Özel", + "Trash": "Çöp Kutusu", + "Inherit": "Miras Al", + "Post Title": "Yazı Başlığı", + "Post Content": "Yazı İçeriği", + "SEO": "SEO", + "SEO Settings": "SEO Ayarları", + "Tags and Categories": "Etiketler ve Kategoriler", + "Tags and Categories Options": "Etiket ve Kategori Seçenekleri", + "Categories": "Kategoriler", + "visibility": "görünürlük", + "Visibility": "Görünürlük", + "Visibility Options": "Görünürlük Seçenekleri", + "status": "durum", + "Password": "Şifre", + "published at": "yayınlanma tarihi", + "Featured Image": "Öne Çıkan Görsel", + "Pages": "Sayfalar", + "Page": "Sayfa", + "Description": "Açıklama", + "Parent Page": "Üst Sayfa", + "Page Order": "Sayfa Sıralaması", + "Post Slug": "Yazı Bağlantısı", + "Write an excerpt for your post": "Yazınız için bir özet yazın", + "Show All posts in": "Tüm yazıları göster:", + "No posts found": "Gönderi bulunamadı", + "Faq": "SSS", + "FAQ": "SSS", + "FAQ Categories": "SSS Kategorileri", + "frequently asked questions": "sıkça sorulan sorular", + "FAQs": "SSS'lar", + "Question": "Soru", + "Answer": "Cevap", + "Clear": "Temizle", + "Showing Search result of": "Arama sonuçları gösteriliyor:", + "Related Posts": "İlgili Yazılar", + "upload": "yükle", + "url": "URL", + "featured image url": "öne çıkan görsel URL'si", + "Navigations": "Menüler", + "Navigation": "Menü", + "Select Post": "Yazı Seçin", + "Select Page": "Sayfa Seçin", + "Recent Post": "Son Yazı", + "Post link": "Yazı bağlantısı", + "Page link": "Sayfa bağlantısı", + "Library link": "Kütüphane bağlantısı", + "External link": "Dış bağlantı", + "Same tab": "Aynı sekme", + "New tab": "Yeni sekme", + "Target": "Hedef", + "Libraries": "Kütüphaneler", + "Image": "Görsel", + "File": "Dosya", + "Video": "Video", + "library": "kütüphane", + "created at": "oluşturulma tarihi", + "Show File": "Dosyayı Göster", + "Library Tags": "Kütüphane Etiketleri", + "Library Title": "Kütüphane Başlığı", + "Library Slug": "Kütüphane URL'i", + "Library Description": "Kütüphane Açıklaması", + "Library Categories": "Kütüphane Kategorileri", + "Library Type": "Kütüphane Türü", + "Library File": "Kütüphane Dosyası", + "file url": "dosya URL'si", + "Tag.Name": "Etiket Adı", + "Slug": "Adres", + "Type": "Tür", + "Handle": "İşleyici Adı", + "Open": "Aç", + "Library": "Kütüphane", + "item": "eleman", + "Item": "Eleman", + "Label": "Etiket", + "Items": "Elemanlar", + "Items count": "Eleman sayısı" +}