your current location:首页 > news>[DT] Dynabranslation (dyntranslation) Minecraft

[DT] Dynabranslation (dyntranslation) Minecraft

2024-12-12 09:24:21|Myriagame |source:minecraft skins

Overview

Dynamic translation is not a popular MOD. He is responsible for providing simple and effective translation for the hard -coding part of the Lang/JSON language file translation of Chinese in the MOD, which is easy to update and modify, and it is also suitable for special operations for integrated packages.

The dynamic translation is mapping all the characters drawn in the game through the name mapping table, thereby achieving the goal of replacement/translation.

Minecraft images

When MOD is localized, sometimes the hard -coding of part of the text cannot be simply international, which makes it difficult for internationalization to work.

Generally, the injection of the source file is required to modify it. On the one hand, the source file is required to change the source file, and it is necessary to repeat the work after updating.

The object of this MOD is the MOD Chinese personnel, and the corresponding players are mainly targeted at some of the international imperfect mods to provide a smooth Chinese experience.

At the same time, in some entertainment directions, we need to replace the text in the game to achieve some special effects. At this time, we also need to modify the text in the game.

Top update content

Corresponding to the original 1.16.x MOD version 1.3.5 Beta and the prompt box of the prompt box of the later version update items;

Training fine -tuning with neural translation in the collection of mainstream mods, reaching the mainstream translator level on Minecraft related corpus sets;

Thanks to the corpus provided by CFPA and all translators participating in the translation.

Online API is published using the CC BY-NC-SA 4.0 protocol.

At this stage, the function is in the test phase, and the network access will be limited (360 visits per hour). The author does not guarantee the stability of the translation service. If you have any questions, please refer to it immediately.

The new number matching is updated to avoid the fast matching and replacement containing the change number.

Use

The suspension pointer is on the item, and hold down the default key position Alt for connected translation.This function cannot translate the creation mode search bar because it intercepts keyboard events.

Dyntranslation replacement time node

Dyntranslation can achieve the above effect by runtime by the mapping table file.

Avoid unnecessary problems by introducing time nodes. When dynamic translation is replaced, it is necessary to lock the configuration file position when the forge completes the initialization.

It is impossible to load the configuration file before the initialization is completed. At the same time, this is also the time to reduce the CPU air rotation time, because a large number of dynamic numbers will produce a large number of dynamic numbers at the time of loading time, causing the translation queue to block, and the CPU resources are consumed too high.

Therefore, before the initialization is completed, the dynamic translation itself cannot replace the text of the loading interface.

Replacement method

Through simple text replacement, the KSON file is used as a carrier here to read the mapping file;

The name of the mapping file is as follows:

Father folder: Under the Config folder of the module, and the subfaming folder will be created as dyntranslation;

Naming subfallets: All submisss must be named by the specifications of dyntranslation_ {name} .json, where {name} is available for all system files.

Minecraft images

Replacement content: MAP nested form based on the standard format of JSON.

For example:

 {// container (GUI) package name, "*" indicates that there is no in any container (GUI), most of the tool prompts;§R ":" §D meat rot §R "," armor ":" "," §7 when wearing on the leg: "§8 when wearing on the leg"}, // here indicates that the character is displayed in Guienchantment"net.minecraft.client.gui.guienchantment": {"enchant": "enchant"}} 

Impact

Because it is replaced by each frame, its performance effect is also proportional to the number of frames, and the final impact result is linear.Among them, the IO operation and word splitting operation is placed in other threads. The final performance impact comes from:

MAP's access performance;

Map size;

Destruction time of thread creation;

The queue obstruction caused by the speed of the new vocabulary is too fast.

The latter two cannot be controlled by manually, so we pay attention to the previous two. The performance of HashMap in the MAP implementation of JDK 1.8 is the highest.The average impact after opening the content of the content is as follows: The figure below:

The average value is 3099.375, the outline is nanoseconds, and the magnitude of less than milliseconds can be considered to be ignored by the impact under sparse operation.

Remark

Minecraft images

For details, please check the MOD tutorial interface of this site.

Lan Zouyun download address:

https://nowandFuture.lanzoui.com/b09fa75kh

This address is provided by the author.