Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem when adding language resources #11

Closed
yuesha-yc opened this issue Jul 18, 2020 · 0 comments
Closed

Problem when adding language resources #11

yuesha-yc opened this issue Jul 18, 2020 · 0 comments

Comments

@yuesha-yc
Copy link

yuesha-yc commented Jul 18, 2020

Hello. I created such a method to register language localization for English and Chinese while registering the item.

    private static Item register(String path, String enName, String cnName, String enTooltip, String cnTooltip, Item item) {
        Identifier itemId = new Identifier("elt", path);
        ITEM_RESOURCE.addLang(new Identifier("elt", "en_us"), JLang.lang().translate("item.elt."+path, enName).translate("item.elt."+path+".tooltip", enTooltip));
        ITEM_RESOURCE.addLang(new Identifier("elt", "zh_cn"), JLang.lang().translate("item.elt."+path, cnName).translate("item.elt."+path+".tooltip", cnTooltip));
        return register(itemId, item);
    }

And I register the items:

    static {
        ELT_SYMBOL = register("symbol", "Symbol", "能级跃迁", "", "", new ItemBase((new Item.Settings()).group(ItemGroups_ELT.ELT_MISC)));
        BRANCH = register("oak_branch", "Oak Branch", "橡木树枝", "A branch", "一根树枝", new ItemBase((new Item.Settings()).group(ItemGroups_ELT.ELT_MATERIAL)));
        BRICH_BRANCH = register("birch_branch", "Birch Branch", "白桦树枝", "A branch", "一根树枝", new ItemBase((new Item.Settings()).group(ItemGroups_ELT.ELT_MATERIAL)));
    }

Problem occurs. ARRP seems to be only registering the translation the first item called (in this case is ELT_SYMBOL), leaving the subsequent items unlocalized in game. I noticed other resources like models and blockstates don't have this problem when I register a lot of items/blocks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant