Jump to content

[DOCS] Localization files - Understanding syntax and load order


Recommended Posts

 Introduction
underline(1).thumb.png.4e21e90c6cd91388d22e46d9a7439364.png
Please do not use this thread to submit requests. They will be ignored.
 

Strings house all of the game's text, from story dialog to UI elements.

There are two locations where you can find strings at:
 

PokeMMO\data\strings - this is the directory where the base-game strings are located / loaded from.

PokeMMO\dump\strings - create this directory from the in-game Settings menu -> Utilities -> Run both string dump utilities


Use the Find in Files function to search these directories for the dialog you are looking for.
While editing game files, it's recommended you use a text editor which is capable of highlighting syntax.


https://notepad-plus-plus.org/


https://www.sublimetext.com/


What is an XML?


It is important that you avoid modifying or replacing any of the existing XML files.
Instead, we can define our own that side-load with the chosen client language.


Why?
 

Files are modified during official updates and the majority of these changes are not logged in the patch notes.

Anything developed on a previous revision more than likely will not be forwards compatible.
Use outdated content at your own risk.


  Formatting and file types
underline(1).thumb.png.6b1c19e73ca25c73a97a516142460d0e.png

Whatever content is at the bottom of the file takes priority over whatever is at the top.
That means you can have multiples of the same string in one file, but whatever is last will end up loading into the game.
 

There are two types of strings; regular strings and archive strings.


Regular strings contain basic string ids:

(found in default directory and in dumps)
 

<string id="0">example</string>


To get your documents ready for your translations, create a new XML file in PokeMMO\data\strings titled z_strings_xx_edits, where xx = your language short-code, e.g., "en" or "es".
 

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<strings is_primary="0" lang="default lang shortcode" lang_full="default full language name">
  <!-- comment example; ignored by game  -->
  <!-- modified strings go inside this code block -->
  <!-- use tab to indent text -->
</strings>


As long as the lang and the lang_full flags match the language which your client is loading, any string you place inside this file will gracefully side-load into the game.

This is relevant for both regular and archive strings. Advantages of utilizing this format include:

  •     ensures you always have the latest game files on your system
  •     not having to define a custom language in-game (causes issues.)
  •     not having to maintain your files as the defaults are overwritten during each update
  •     the "is_primary=0" flag allows Gilan's Encounter Counter to function properly


Archive strings contain block ids, entry ids, and table ids:
(found only in dumps)
 

 <string block_id="0" entry_id="0" table_id="0">example</string>


 

There are two types of archive strings; Sinnoh and Unova.
 

To get your documents ready for your translations, create a new XML file in PokeMMO\data\strings titled z_strings_x_edits, where x = the region which you're modifying.

Sinnoh:
(region_id="3")
 

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<ds_strings_archive archive_type="0" is_primary="0" lang="default lang shortcode" region_id="3">
  <!-- comment example; ignored by game  -->
  <!-- modified strings go inside this code block -->
  <!-- use tab to indent text -->
</ds_strings_archive>


Before continuing it is extremely important to understand that when you re-import Unova strings while using English or a custom client language, you will encounter an "issue" where the game will revert to using the internal dump version of files. That means if you have any string that edits region_id="2" on your system- all MMO specific dialog is not being displayed.

Correct dialog with "proper" string files:

unknown.png  unknown.png
Updated Smoke Ball description / breeding item text

Incorrect dialog from "bad" string files:

unknown.png  image.png.bd41998ba51b5d1c76b456f948e8ef33.png
Old Smoke Ball description / missing breeding item text

These are single examples of dialog displaying improperly / straight from the ROMs. There's approximately 48 thousand lines of dialog in the Unova region alone, that is essentially the entire game's worth of monster, item and ability descriptions, conversations etc- anything the developers made specifically for the MMO is not being displayed.


To circumvent this, use this placeholder file @realmadrid1809 and I created.

Create a new XML file in PokeMMO\data\strings titled a_placeholder_for_enabling_unova_edits:
 

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<strings lang="en" lang_full="English" is_primary="1">
  <string id="0987654321234567890"> </string>
<!-- If you remove this file, you will load over 48,000 lines of incorrect dialog.
The game will revert to using the internal dump version of files when reimporting Unova strings.
That means if you have any string that edits region_id="2" on your system- all MMO specific dialog is not being displayed. 
You may repurpose this file for your own use if you wish, however- please credit nurver, realmadrid1809 and AnonymousPoke. -->
</strings>


Without a file similar to this, your game is displaying dialog from the ROMs, not the MMO. In other words, your game is outdated.
 

Unova:

(region_id="2")
 

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<ds_strings_archive archive_type="0" is_primary="0" lang="default lang shortcode" region_id="2">
  <!-- comment example; ignored by game  -->
  <!-- modified strings go inside this code block -->
  <!-- use tab to indent text -->
</ds_strings_archive>


There are two types of Unova strings; archive_type="0" and archive_type="1".
Amend the archive_type flag to match the dialog being modified.
 


   Final thoughts

underline(1).thumb.png.b75986e17a754084b8fc95803aa62f8f.png
List of additions / changes to the game files: https://forums.pokemmo.com/index.php?/topic/150659-docs-psa-to-themers-and-modders

  • Conversations can source dialog from multiple string entries, even from other regions whilst in a totally different one
  • You can only shorten string load time by removing existing line breaks "\n" and turning multiple sentences into a single short one
  • Every area of each region is handled differently. Dialog that is tied to animation or background scripts behaves differently than others
  • Files can technically be titled anything- as long as they load after your main files, but the Unova placeholder must remain the first file that loads
  • Check the console.log in PokeMMO\log to confirm what order your game is loading your files
  • Do not store extra copies or other unused loose files in the strings directory


Please ensure you have repaired your client and cleaned your game directories before reporting bugs. It wastes the time of everyone involved.

If you have further questions or require assistance, feel free to reach out.
 

743352385262583858?color=inactive&label=discord&logo=discord&logoColor=white
 

Edited by nurver9
Link to comment
On 10/19/2022 at 8:31 PM, nurver9 said:

 Create a new XML file in PokeMMO\data\strings titled a_placeholder_for_enabling_unova_edits:
 

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<strings lang="en" lang_full="English" is_primary="1">
  <string id="0987654321234567890"> </string>
</strings>


Without a file similar to this, your game is displaying dialog from the ROMs, not the MMO. In other words, your game is outdated.
 

@nurver9Thanks for this information, I have something to clarify though since the topic is load order.

 

`a_placeholder_for_enabling_unova_edits.xml`

 

Am I correct in saying the game will only load this file as a primary string container if it is ahead of the other possible string containers in alphabetical order?

Link to comment
2 hours ago, ShaoYuWeiZZ said:

@nurver9Thanks for this information, I have something to clarify though since the topic is load order.

 

`a_placeholder_for_enabling_unova_edits.xml`

 

Am I correct in saying the game will only load this file as a primary string container if it is ahead of the other possible string containers in alphabetical order?

Yes, out of all string files with the is_primary="1" flag it will choose the first one in alphabetical order

Link to comment
  • 2 weeks later...
On 10/19/2022 at 12:31 PM, nurver9 said:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<ds_strings_archive archive_type="0" is_primary="0" lang="default lang shortcode" region_id="3">
  <!-- comment example; ignored by game  -->
  <!-- modified strings go inside this code block -->
  <!-- use tab to indent text -->
</strings>

Noticed here it doesn't load anything since it mismatches <ds_strings_archive> with </strings>.

Changing </strings> to </ds_strings_archive> solves the issue.

Link to comment
  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.