Eksik locale stringleri için hata düzenlemesi

  • Konbuyu başlatan Konbuyu başlatan Admin
  • Başlangıç tarihi Başlangıç tarihi
  • Cevaplar Cevaplar 0
  • Görüntüleme Görüntüleme 146

Admin

Metin2Lobby
Yönetici
Founder
Katılım
6 Mayıs 2022
Mesajlar
52,647
Ticaret : 1 / 0 / 0
locale_string.txt'de olmayan stringler için kolaylıkla sourcedeki yerini bulabilemniz için ufak bir düzenleme paylaşıcam.

raw


Kod:
const char *locale_find(const char *string);

Değiştir:
Kod:
const char* locale_find(const char* string, const char* file, const char* function, int line);

---

Arat:
Kod:
#define LC_TEXT(str) locale_find(str)

Değiştir:
Kod:
#define LC_TEXT(str) locale_find(str, __FILE__, __FUNCTION__, __LINE__)

* locale.cpp

Arat:
Kod:
const char * locale_find(const char *string)

Değiştir:
Kod:
const char* locale_find(const char* string, const char* file, const char* function, int line)
---

Arat:
Kod:
sys_err("LOCALE_ERROR: \"%s\";", string);

Değiştir:
Kod:
sys_err("LOCALE_ERROR: \"%s\"; (%s:%s:%d)", string, file, function, line);

Eksik Locale Stringleri İçin Hata Düzenlemesi

Metin2 özel sunucularında geliştirme yaparken karşılaşılan yaygın sorunlardan birisi eksik locale stringleridir. Bu durum, oyuncuların bazı metinleri görememesine, sistemsel uyarıların düzgün görüntülenmemesine ya da hatalı çevirilere neden olabilir. Bu yazıda, Metin2 özel sunucu geliştiricileri için eksik locale stringlerinin tespiti ve düzeltilmesi sürecini detaylı olarak ele alacağız.

Locale Nedir?

Locale kavramı, uygulamanın farklı dillere nasıl uyum sağladığını tanımlar. Metin2 özel sunucularda genellikle 'locale' adı verilen klasörlerde dil dosyaları barındırılır. Bu dosyalar, oyun içinde kullanılan metinlerin doğru dilde görünmesini sağlar. Örneğin, bir butonun 'Sil' yerine 'Delete' veya 'Löschen' olarak görünmesi gibi.

Eksik Locale Stringleri Neden Sorun Yaratır?

Eğer bir string locale dosyasında eksikse veya tanımlı değilse, oyun genellikle boş bırakılır ya da sistemsel hata mesajları gösterilir. Bu da kullanıcı deneyimini ciddi şekilde etkiler. Özellikle PvP sistemlerinde, item isimleri, yetenek açıklamaları, sistem uyarıları gibi kritik alanlarda eksik stringler büyük sorunlara yol açabilir.

C++ Kaynak Kodlarda Eksik String Tespiti

Metin2'nin server-side geliştirme kısmında C++ kaynak kodlar kullanılır. Client-side tarafında ise UIscript, Py Root gibi Python tabanlı sistemler devreye girer. Kaynak kodda bir string çağrısı yapıldığında, sistem locale dosyasından bu değeri çeker. Eğer değer bulunamazsa, sistem genellikle ID numarasını ekrana basar. Bu da geliştiriciye eksik string olduğunu gösterir.

Hata Ayıklama Adımları

1. Oyunda eksik görünen metni tespit edin. Genellikle ID numarası şeklinde olur.
2. Server loglarını kontrol edin. Burada missing locale hatası yer alabilir.
3. Locale dosyasında eksik olan stringi bulun.
4. Gerekli stringi doğru formatta locale dosyasına ekleyin.

Python GUI ve Py Root Bağlantısı

Py Root ve UIscript kullanılarak geliştirilen arayüzlerde, lokalizasyon doğrudan C++ tarafında değil, Python tarafında da kontrol edilebilir. Bu durumda, eksik string hataları Python tarafında da takip edilmelidir. Özellikle GUI üzerinden çalışan sistemlerde, stringlerin doğru alınması için hem C++ hem de Python kodları kontrol edilmelidir.

DB ve Auth Tarafında Locale Kullanımı

Metin2'nin database (DB) ve authentication (auth) süreçlerinde de lokalizasyon kullanılabilir. Örneğin, sistemsel hata mesajları, hesap bildirimleri gibi alanlarda eksik stringler olabilir. Bu durumda DB tarafında da uygun alanlara locale stringlerin eklenmesi gerekir.

Örnek Hata ve Çözümü

Oyun içinde bir item ismi yerine 1001 gibi bir ID görülmüşse, bu eksik locale anlamına gelir. locale_game.txt dosyasına şu şekilde bir satır eklenmelidir:
string_list =
{
[ID] = [TR]Silah
}

Sonuç

Eksik locale stringlerinin düzeltilmesi, Metin2 özel sunucularında kullanıcı deneyimini artırmak için kritik öneme sahiptir. Geliştiricilerin, C++, Python ve DB katmanlarında bu konuya dikkat etmeleri gerekir. Doğru yapılandırılmış bir locale sistemi, sunucunuzun profesyonelliğini ve kalitesini artırır.


Error Correction for Missing Locale Strings

One of the common issues encountered during Metin2 private server development is missing locale strings. This situation may cause players not to see certain texts, prevent proper display of system warnings, or result in incorrect translations. In this article, we will detail the process of detecting and fixing missing locale strings for Metin2 private server developers.

What is Locale?

The term locale defines how an application adapts to different languages. In Metin2 private servers, language files are usually stored in folders named 'locale'. These files ensure that texts used within the game appear in the correct language. For instance, a button might appear as 'Delete' or 'Löschen' instead of 'Sil'.

Why Do Missing Locale Strings Cause Issues?

If a string is missing or undefined in the locale file, the game typically leaves it blank or displays system error messages. This significantly impacts user experience. Especially in PvP systems, missing strings in critical areas like item names, skill descriptions, and system alerts can lead to serious problems.

Detecting Missing Strings in C++ Source Code

On the server-side development of Metin2, C++ source codes are used. On the client-side, Python-based systems such as UIscript and Py Root are utilized. When a string is called in the source code, the system fetches its value from the locale file. If the value is not found, the system generally displays the ID number. This indicates to the developer that there is a missing string.

Debugging Steps

1. Identify the missing text in the game. It often appears as an ID number.
2. Check the server logs. Missing locale errors may appear here.
3. Locate the missing string in the locale file.
4. Add the required string to the locale file in the correct format.

Connection with Python GUI and Py Root

In interfaces developed using Py Root and UIscript, localization can also be controlled on the Python side. In such cases, missing string errors should also be monitored on the Python side. Particularly in GUI-driven systems, both C++ and Python codes must be checked to ensure strings are properly retrieved.

Locale Usage in DB and Auth Sides

Localization can also be used in database (DB) and authentication (auth) processes of Metin2. For example, system error messages and account notifications may have missing strings. In this case, locale strings must be added to the appropriate fields in the DB side as well.

Example Error and Solution

If an item name appears as an ID like 1001 instead of its actual name in-game, it indicates a missing locale. A line like the following should be added to the locale_game.txt file:
string_list =
{
[ID] = [EN]Weapon
}

Conclusion

Correcting missing locale strings is crucial for enhancing user experience in Metin2 private servers. Developers must pay attention to this aspect across C++, Python, and DB layers. Properly configured locale systems increase the professionalism and quality of your server.
 

Şuan Bu Konuyu Görüntüleyen Kullanıcılar (Toplam : 0, Üye : 0, Misafir : 0)

Geri
Üst Alt