User Tools

Site Tools


tutorial:lang

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
tutorial:lang [2019/07/24 16:48] – Fix text not being in code fudgetutorial:lang [2022/01/24 12:49] – Fix missing comma mattidragon
Line 37: Line 37:
 </code> </code>
  
-And the tooltip will be displayed as "My Tooltip" !+And the tooltip will be displayed as "My Tooltip"!
  
 ==== Adding dynamic values to translatable text ==== ==== Adding dynamic values to translatable text ====
Line 55: Line 55:
  
 And the tooltip will be displayed as "My Tooltip in day 4, and month 7" And the tooltip will be displayed as "My Tooltip in day 4, and month 7"
-In order to pass a string, we use ''%s'' instead of ''%d''+In order to pass a string, we use ''%s'' instead of ''%d''. If you want for it to literally show ''%'', use ''%%''
 For more information, see [[https://dzone.com/articles/java-string-format-examples|Java String.format]] (it works the same way). For more information, see [[https://dzone.com/articles/java-string-format-examples|Java String.format]] (it works the same way).
  
Line 62: Line 62:
 <code JavaScript resources/assets/tutorial/lang/en_us.json> <code JavaScript resources/assets/tutorial/lang/en_us.json>
 { {
-  "item.tutorial.fabric_item.tooltip_1": "Line 1 of my tooltip" +  "item.tutorial.fabric_item.tooltip_1": "Line 1 of my tooltip"
   "item.tutorial.fabric_item.tooltip_2": "Line 2 of my tooltip"    "item.tutorial.fabric_item.tooltip_2": "Line 2 of my tooltip" 
 } }
Line 79: Line 79:
 ====== Translation format ====== ====== Translation format ======
 The translation key for objects you have registered is in the form The translation key for objects you have registered is in the form
-<code><object-type>.<modid>.<registry-id></code+''<object-type>.<namespace>.<path>'' (namespace and path as defined by the registered ''Identifier'').
  
 ^ Object Type      ^ Format       ^ Example          ^ ^ Object Type      ^ Format       ^ Example          ^
-| Block          | <code>block.<modid>.<registry-id></code>     |<code>"block.tutorial.example_block": "Example Block"  </code>       | +| Block          | ''block.<namespace>.<path>''     |''"block.tutorial.example_block": "Example Block"''       | 
-| Item    |<code> item.<modid>.<registry-id> </code> |<code> "item.tutorial.my_item": "My Item"</code> +| Item    |''item.<namespace>.<path>'' |''"item.tutorial.my_item": "My Item"'' 
-| ItemGroup | <code> itemGroup.<modid>.<registry-id></code> | <code> "itemGroup.tutorial.my_group": "My Group"</code>+| ItemGroup | ''itemGroup.<namespace>.<path>'' ''"itemGroup.tutorial.my_group": "My Group"''
-| Fluid | <code> fluid.<modid>.<registry-id> </code> || +| Fluid | ''fluid.<namespace>.<path>''|| 
-| SoundEvent | <code> sound_event.<modid>.<registry-id> </code> || +| SoundEvent | ''sound_event.<namespace>.<path>''|| 
-| StatusEffect | <code> mob_effect.<modid>.<registry-id> </code> || +| StatusEffect | ''effect.<namespace>.<path>''|| 
-| Enchantment | <code> enchantment.<modid>.<registry-id> </code> || +| Enchantment | ''enchantment.<namespace>.<path>''|| 
-| EntityType | <code> entity_type.<modid>.<registry-id> </code> || +| EntityType | ''entity.<namespace>.<path>''|| 
-Potion <code> potion.<modid>.<registry-id> </code> || +Biome ''biome.<namespace>.<path>''|| 
-Biome <code> biome.<modid>.<registry-id> </code> || +Stat ''stat.<namespace>.<path>''||
- +
-For types not in this list, see ''net.minecraft.util.registry.Registry.java''+
- +
  
 +For types not in this list, see ''net.minecraft.util.registry.Registry''.
tutorial/lang.txt · Last modified: 2024/02/06 10:26 by rawdiamondmc