Raised This Month: $4 Target: $400

Map specific translation files

Post New Thread Reply   
Thread Tools Display Modes
Author Message
Veteran Member
Join Date: Nov 2012
Old 12-25-2020 , 06:57   Map specific translation files
Reply With Quote #1

I'm writing a plugin which will load translations for each map. For de_dust it will be like this:


In the documentation is said that the translations are automatically reloaded on map change but nothing is said how to unload translations which are no longer used.
1) If the plugin runs through 100 maps will it have cached in the memory translations for each of these 100 maps?
2) If yes, what is the right way to clear the cache?
3) If not possible, how can I be sure that a translation for specific phrase is taken from the right file (in case some phrases exist in several files)?
4) Is there a way to check if the translation file is loaded successfully (exist)?

Last edited by kadet.89; 12-25-2020 at 07:21.
kadet.89 is offline
Send a message via Skype™ to kadet.89
Senior Member
Join Date: Nov 2015
Location: AlliedMods.net
Old 12-25-2020 , 07:24   Re: Map specific translation files
Reply With Quote #2

Translations are reloaded from files using plugin's translation cache (list of translation files (and all phrases from these files) attached to the plugin).
This cache can be purged only by unloading the plugin self.
MAGNAT2645 is offline
Veteran Member
Join Date: Nov 2017
Location: Ukraine
Old 12-26-2020 , 16:19   Re: Map specific translation files
Reply With Quote #3

kadet, if you are completely sure it is REALLY necessary, the dirty way is to dynamically overwrite the plugin's main translation file and apply server command "sm_reload_translations".
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch)
[My plugins] [My tools] [GitHub] [Articles] [Donate]

Last edited by Dragokas; 12-26-2020 at 16:20.
Dragokas is offline

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -4. The time now is 12:38.

Powered by vBulletin®
Copyright ©2000 - 2021, vBulletin Solutions, Inc.
Theme made by Freecode