Changes

Jump to navigation Jump to search
→‎Content pack API: + content pack translations in SMAPI 3.0
Line 57: Line 57:  
<source lang="c#">
 
<source lang="c#">
 
tilesheet.ImageSource = contentPack.GetActualAssetKey("image.png");
 
tilesheet.ImageSource = contentPack.GetActualAssetKey("image.png");
 +
</source>
 +
 +
===Get translations===
 +
{{SMAPI upcoming|3.0}}
 +
 +
You can read translations from the content pack's <tt>i18n</tt> folder. This is identical to the [[Modding:Modder Guide/APIs/Translation|translation API]], but accessed through <tt>contentPack.Translations</tt>:
 +
<source lang="c#">
 +
string text = contentPack.Translations.Get("item-type.label");
 
</source>
 
</source>
  
translators
8,404

edits

Navigation menu