Lang API

Automatically translates rust item display names & descriptions to use in you're plugins
Description
Automatically translates rust item display names & descriptions to use in you're plugins.
Most Recent Update for Repo is 12-16-2021 at 1 pm ( Pacific Standard Time )
Features
- No config!
- Automatic language generations!
- Supports All 30 Rust Native Translations!
- Works With the latest GUIShop beta branch, StackModifier, and EasyResearch!
- GitHub repository is updated when Facepunch updates which in return means as soon as your server is rebooted or you reload this plugin it will take effect!
- code
1 // OnLangAPIFinished is called when LangAPI is finished processing 2 private bool _isLangAPIReady; 3 private void OnLangAPIFinished() 4 { 5 _isLangAPIReady = true; 6 } 7 8 // Added IsReady bool which will return true/false when your plugin is loaded to know if it's ready 9 // Example usage below. 10 private void OnServerInitialized() 11 { 12 if (LangAPI != null && LangAPI.IsLoaded) 13 _isLangAPIReady = LangAPI.Call<bool>("IsReady"); 14 } 15 16 //How to properly check valid displaynames when using custom item displaynames in plugins. 17 //Example first hook call usage method expects item.DisplayName.english ( returns true or false ) 18 //Example second hook call usage method expects item.shortname, item.DisplayName.english, player.UserIDString 19 string GetItemDisplayName(string shorname, string displayName, string userID) 20 { 21 if (LangAPI != null && LangAPI.Call<bool>("IsDefaultDisplayName", displayName)) 22 { 23 return LangAPI.Call<string>("GetItemDisplayName", shorname, displayName, userID) ?? displayName; 24 } 25 return displayName; 26 } 27 28 29 //Example expects the item.shortname, item.displayName.english, player.UserIDString 30 //Return type is string 31 LangAPI.Call<string>("GetItemDisplayName", "rifle.ak", "Assault Rilfe", player.UserIDString) 32 33 //Example expects the item.shortname, item.displayDescription.english, player.UserIDString 34 //Return type is string 35 LangAPI.Call<string>("GetItemDescription", "rifle.ak", "High damage machine rilfe", player.UserIDString) 36 37 //Added a new API bool check to detect valid item display names. 38 //Return type is bool 39 LangAPI.Call<bool>("IsDefaultDisplayName", "Assault Rifle") 40 41 // IsReady bool will return true/false when your plugin is loaded to know if it's ready 42 LangAPI.Call<bool>("IsReady")
Sponsored


Trusted hosting partner. Affordable game servers with solid support and panels.
Visit site ↗Free
DownloadViews1.1k
Downloads41
Purchases0
Rating★ 0.0
Version1.0.5
Compile check✓ Passed Oct 14, 2026
PlatformRust
CategoryPlugins
CompatibleOxide
Size5 KB
PublishedNov 30, 2021
UpdatedDec 23, 2021
✓ Reviewed for safety and integrity