Jump to content

Bug report: Localization files are ignored (messages always shown in server default language)

Pending 1.4.6

tsuyoshi_ito
tsuyoshi_ito

Posted (edited)

Hi, thank you for the great plugin. I found a localization issue in Chest Stacks v1.4.6 and would like to report it along with a fix.

*Issue
Player-specific language files (e.g. `oxide/lang/ja/ChestStacks.json`) are never used. All chat messages are always displayed in the server's default language.
 

*Cause
`lang.GetMessage()` is called without the player's userId, so the Lang API always falls back to the server default language instead of each player's language.

*Fix
I modified `GetLangKeyString()` to accept the player and pass `player.UserIDString` to `lang.GetMessage()`, and updated the four call sites accordingly. After this change, each player receives messages in their own client language.

I have attached the fixed `ChestStacks.cs` and a diff patch (`ChestStacks-i18n.patch`). It would be great if this could be included in a future release.

Thanks!

 

 

 

ChestStacks.cs ChestStacks-i18n.patch.txt

Edited by tsuyoshi_ito
  • Like 1

About Us

Codefling is the largest marketplace for plugins, maps, tools, and more, making it easy for customers to discover new content and for creators to monetize their work.

Downloads
2.9m
Total downloads
Customers
11.8k
Customers served
Files Sold
168.3k
Total sales
Payments
3.6m
Processed total
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.