UNIVERSAL TRANSLATOR EN ⇄ VI  v2.0.0
Translates English → Vietnamese AND Vietnamese → English, FULLY OFFLINE, for Minecraft Bedrock (Script API).
This is a rule-based translation engine (a dictionary of 5,000+ root words plus their inflected forms,
~240 fixed phrases and ~120 chat abbreviations, covering many topics: daily life, work/business, study,
technology, travel, food, sports, entertainment, emotions/personality, and both formal and casual
conversation patterns, with basic grammar). It is NOT an AI.

=== PICK THE RIGHT PACK ===
1) UVT_EN-VI_v2.0_STABLE.mcpack   — always runs, no experiments required. It cannot translate
   automatically (stable Minecraft does not allow intercepting chat); the /translate command is still
   registered but there is nothing left to toggle.
2) UVT_EN-VI_v2.0_BETA_26.30.mcpack / _26.40 / _26.50 — AUTOMATICALLY translates every chat message,
   fully replacing the original line with the translation. Nothing else to do; it is ON by default for
   everyone. Requirements: enable "Beta APIs" in World Settings → Experiments, and pick the pack that
   matches your game version (26.30.x → the 26.30 pack; 26.40.x → the 26.40 pack; 26.50.x → the 26.50
   pack). With a mismatched version the script will not load.
   (Reason: the Script API chat events are still beta; the stable build does not have them.)
Only enable ONE translation pack per world.

=== INSTALLATION ===
Open the .mcpack file with Minecraft → enter the world → Behavior Packs → activate the pack. That is all —
with a BETA pack, other players' chat is translated for you automatically.
No message is shown when you join the game; the addon works silently in the background.

=== THE ONLY COMMAND: /translate ===
/translate            Show your current status (on/off, and which language you translate into).
/translate on         Turn translation on for yourself only (already on by default).
/translate off        Turn translation off for yourself only — you will see the original text; other
                      players are not affected.
/translate vi         Choose: other players' chat is translated into VIETNAMESE for you.
/translate en         Choose: other players' VIETNAMESE chat is translated into ENGLISH for you.
                      (The addon detects by itself whether a message is English or Vietnamese; a message
                      already in your chosen language is left untouched.)
The on/off and vi/en settings are PER PLAYER — one player enabling it does not affect anyone else.
You can type /tr instead of /vi:translate if no other command on the server uses that short name.
The sender always sees their own message verbatim; the translation (plain white text, no special colour)
is shown only to OTHER players who have /translate vi enabled.

=== WHAT THE ENGINE CAN DO ===
- Greetings/fixed phrases, chat abbreviations (gg, brb, idk, thx, pls...).
- Yes/no questions, what/where/who/why/how/how many questions, imperatives, negation.
- Tenses (past/continuous/future), modal verbs (can/should/must...), comparison, possession ('s, my, your).
- English → Vietnamese word-order inversion (adjective after noun, "iron sword" → "kiếm sắt") and
  classifiers ("3 diamonds" → "3 viên kim cương", "a sword" → "một thanh kiếm").
- Vocabulary across many topics: daily life, work, study, technology, travel, food, sports, entertainment,
  emotions/personality, and both formal and casual conversation.
- Words missing from the dictionary (player names, unknown words) are kept as-is. If the translation
  recognises <60% of the words, or the message is already in the target language, the addon keeps the
  original instead of showing a wrong translation.
Vietnamese → English direction (new in v2.0): it infers tense, plurals, articles (a/the) and English word
order, because Vietnamese does not mark those — so accuracy is lower than the English → Vietnamese
direction; it also understands Vietnamese typed without diacritics.
Limits: long/complex sentences, nested clauses, rare idioms and uncommon slang may be translated poorly.

=== TROUBLESHOOTING ===
Enable the Content Log (Settings → Creator → Content Log GUI) and look for lines starting with "[UVT]".
- "chatHook=none"   → you are using the STABLE pack (by design), or Beta APIs is not enabled.
- "chatHook=after"  → the game can only append the translation, it cannot replace the original line (some
  older game versions); every /translate command still works normally, the only difference is that the
  original line cannot be removed.
- "chatHook=before" → everything works fully, including replacing the original line.
- No "[UVT] loaded" line → the script did not load: wrong BETA pack version, or the pack is not activated.

=== EXTENDING THE DICTIONARY ===
The dictionary lives in the scripts/ folder: lexicon.js (curated entries, with part of speech) and the
ext*_*.js files (lists in the form  word=meaning#part_of_speech  separated by |). Add new words to the
matching ext file, then re-zip as a .mcpack. Entries in lexicon.js always take priority over ext* files.
