[BNW] French translation of mods

Akallan

Chieftain
Joined
Jun 28, 2018
Messages
4
Hello everyone, I'm new here and I do not know if this is the right category to post my problem, feel free to move it. I looked on the internet if other people had the same problem as me, but I did not find anything so I start the topic here.

I want to translate some mods I have for Civ5 in French. I managed to locate the text files of mods and I modified the texts in French, the approach is overall good and the changes are good, but there is obviously a problem: letters with special characters like "é" , "è", "à", etc ... do not display and create gaps in the descriptions.

I made two pictures so that you can see the situation yourself:




The first time I translated the mod, I left the code "<Language_en_US>", and there was this problem of special characters. I then changed the code to "<Language_fr_FR>" thinking it would fix the problem, but not at all.

Does anyone know where the problem comes from?
Thank you in advance!

Akallan
 
Only way I've ever got this to reliably work is with numeric entities, for example

Code:
<?xml version="1.0" encoding="utf-8"?>
<GameData>
  <Language_en_US>
    <Row Tag="TXT_KEY_DO_CS_STATUS_CITY_STATE" >
      <Text>City State</Text>
    </Row>
    <Row Tag="TXT_KEY_DO_CS_STATUS_ALLIED_WITH" >
      <Text>Allied With</Text>
    </Row>
    <Row Tag="TXT_KEY_DO_CS_STATUS_PROTECTED_BY" >
      <Text>Protected By</Text>
    </Row>
    <Row Tag="TXT_KEY_DO_CS_STATUS_QUESTS" >
      <Text>Quest(s)</Text>
    </Row>
  </Language_en_US>

  <Language_fr_FR>
    <Row Tag="TXT_KEY_DO_CS_STATUS_CITY_STATE" >
      <Text>Cit&#233;-&#201;tat</Text>
    </Row>
    <Row Tag="TXT_KEY_DO_CS_STATUS_ALLIED_WITH" >
      <Text>Alli&#233; avec</Text>
    </Row>
    <Row Tag="TXT_KEY_DO_CS_STATUS_PROTECTED_BY" >
      <Text>Prot&#233;g&#233; par</Text>
    </Row>
    <Row Tag="TXT_KEY_DO_CS_STATUS_QUESTS" >
      <Text>Qu&#234;te(s)</Text>
    </Row>
</GameData>
 
SLGray : I have already read this topic. But I do not know if it will solve my problem, thank you for your help!

whoward69 : Thank you for your help too, your solution works. I did not immediately understand how your hint worked, but I studied it and I noticed that there is always the beginning of code "& #" and then the number of the letter wanted. I looked at OpenOffice and I found the same numbers. Your trick is working properly, thank you again!
 
It's probably obvious, but still: It's much easier (and faster) to just write the text normally and then do a mass-replace text action for each of the letters afterwards.
Depending on the program you're using, you can even write a script that does the conversion for you.
 
Ryika : Yes, I proceed in this way. And I finally could translate almost all my mods. What software are you talking about?
 
Last edited:
In Notepad++ for example, you can do mass replaces by doing the following:

In the "Find What"-Field, enter: (é)|(è)|(ê)
In the "Replace With"-Field, enter: (?1&#233;)(?2&#232;)(?3&#234;)
Set 'Search Mode' to 'Regular Expression', and make sure 'Match Case' is selected (as é and É have different codes).

If you run that replace action, all three of those letters will be replaced with the code-version in one action, instead of having to do them 1-after-the-other.
If you create such an action that has all the letters that are specific to the french language and save it in a file somewhere, you can save an immense amount of manual work. You just write the text, the copy-paste both strings into the search fields, and let the program do the rest.

Other programs will have different syntax of course. I don't think that's possible in the SDK for Civ V, but of course you can just exit the program, open the project's Text-Folder in Notebad++ and do that mass replace before heading back to the SDK.
 
Ryika : Thanks for the advice, I'll see what the software looks like, it looks interesting!
 
Top Bottom