Skip to content

Commit 16cf054

Browse files
committed
Localization docs
1 parent c4332b8 commit 16cf054

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/main/java/org/j1sk1ss/menuframework/common/LocalizationManager.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,23 @@
88
import java.util.ArrayList;
99

1010

11+
/**
12+
* Localization manager based on CordellDB
13+
* Main idea, that every MenuWindow will have own CDB for translation
14+
* For creation a new localization file you will need:
15+
* - Every line of file - one component
16+
* - Key and value in CordellDB separated by ":"
17+
* - Key should have LNG_ prefix. Also key should copy name of component for localization
18+
* - Example: EN_button1:ButtonName/ButtonLore
19+
* - Example: EN_panel:InventoryName/-
20+
* - Example: IT_button1:ButtonNome/ButtonStoria
21+
* - Example: RU_button1:Кнопка/- (- means saving lore (Or name))
22+
* Then just get panel with lang (from prefix), and show it for player:
23+
* - Example: windowMenu.getPanel("panel1", "RU").getView(player);
24+
* Notes:
25+
* - Avoid localization for panels
26+
* - Remember that MenuFramework don`t know player`s native language. You should detect this by yourself.
27+
*/
1128
public class LocalizationManager {
1229
public LocalizationManager(String localization) {
1330
LocManager = new Manager(localization);

0 commit comments

Comments
 (0)