Live
PumpkinKing reacted 🔥 to AchievementsWrecks updated AchievementsWrecks updated VIP PackagesRazor updated Animal FarmRazor updated Animal FarmEM$Ø reacted ⭐ to rPhonestev reacted ❤️ to Grid ControlMoulinch reacted ❤️ to Grid ControlMoulinch followed @khaledKhaled published Grid ControlRazor updated Animal Farm Probadgyver updated CHRONUSRustFlash updated MyServerGearxNullPointer95 updated Infinite DurabilityRazor updated Auto FarmRazor updated Animal Farm ProRazor updated Animal Farm ProRazor updated Animal Farm ProKhaled updated Recycler Stationmagnumk reacted ❤️ to Halloween AtmosphereRustFlash published Halloween EventBrad Copp updated Water Wheel UpgradesBrad Copp updated Solar Panel UpgradesBrad Copp updated Biofuel Generator UpgradesBrad Copp updated Windmill UpgradesBL3CKD3RK reviewed rPhoneBL3CKD3RK reacted ⭐ to rPhoneRustFlash updated MyServerGearAlexProjects updated Zombie Swarm PROKhaled updated Heli Loadout

Lang API

Khan★ 0.0 (0)v1.0.5Oxide
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
    2private bool _isLangAPIReady;
    3private 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.
    10private 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
    19string 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
    31LangAPI.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
    35LangAPI.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
    39LangAPI.Call<bool>("IsDefaultDisplayName", "Assault Rifle")
    40
    41// IsReady bool will return true/false when your plugin is loaded to know if it's ready
    42LangAPI.Call<bool>("IsReady")
Sponsored
Pine Hosting
Pine Hosting

Trusted hosting partner. Affordable game servers with solid support and panels.

Visit site ↗
Free
Download
Views1.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