Greavesy1899 / MafiaToolkit

Open source toolkit for Mafia games. (Mafia II, Mafia III, Mafia DE)
MIT License
122 stars 20 forks source link

Localize #82

Closed MohammedXD29 closed 1 year ago

MohammedXD29 commented 1 year ago

Hi, I'm trying to translate Mafia DE to Arabic and I extracted sds to xml and translated the file but when I click import it shows me an error "Object reference not set to an instance of an object" but if I import the original XML it will import without any problem, so what I have to do? Sorry for bad English, I think.

Greavesy1899 commented 1 year ago

Need more information - which SDS are you trying to edit? Is this an XBin file, or something different?

MohammedXD29 commented 1 year ago

Need more information - which SDS are you trying to edit? Is this an XBin file, or something different?

Yes, it's XBin. file name is "Stringtable_en_common_group.XBin"

Greavesy1899 commented 1 year ago

Can you please send me the file you are attempting to import into the Xbin editor?

MohammedXD29 commented 1 year ago

https://www.mediafire.com/file/hxpdcuktol59rcl/stringtable_en_common_group.xml/file

Greavesy1899 commented 1 year ago

Your XML appears to be using the old format, which is no longer supported. You need to export a new XML using version 2.28.

MohammedXD29 commented 1 year ago

I will try with the old version

MohammedXD29 commented 1 year ago

I tried with the same version of the XML file and it's the same error

Greavesy1899 commented 1 year ago

Please use 2.28 and re-export the XML, and try again on the same version.

MohammedXD29 commented 1 year ago

What about the translated strings?

Greavesy1899 commented 1 year ago

You can copy them into the new XML. The change in XML format was due to a serious bug which broke StringTables. I strongly recommend to use 2.28, and copy your translated strings over to the new XML.

MohammedXD29 commented 1 year ago

OK, thank you so much.

MohammedXD29 commented 1 year ago

It didn't work, I copied the codes from the new one to the old and it didn't work, I tried to fix it but I fail

Here's the file : stringtable_en_common_group.txt just change it to XML.

Greavesy1899 commented 1 year ago

You have broken the XML format. Just change the element "Content" and nothing else. Do not change any "LocalisableString" eleemnts.

MohammedXD29 commented 1 year ago

Wich content you mean? this /content or this content ? and change it to what?

Greavesy1899 commented 1 year ago

image

You only need to edit these lines. You do not need to edit LocalisableString

MohammedXD29 commented 1 year ago

OK, you mean to delete / ? or what.

Greavesy1899 commented 1 year ago

You have to make sure that the LocalisableString is in exactly the same format as above. If it as a "/" at the end, then remove it.

MohammedXD29 commented 1 year ago

But / is in the start in content and LocalisableString Like /LocalisableString /content

Greavesy1899 commented 1 year ago

I'm not sure I understand. If you want to translate the strings, all you need to edit is the contents inside the element. Just leave the LocalisableString element as it is. From what I see from the previous txt document, you have also copied and replaced LocalisableString, which is causing problems.

MohammedXD29 commented 1 year ago

My brain is going to explode soon.

MohammedXD29 commented 1 year ago

Can you do it for me?

Greavesy1899 commented 1 year ago

What do you want me to do?

MohammedXD29 commented 1 year ago

import the file 😅

Greavesy1899 commented 1 year ago

I can provide you an example, but i'm not doing it for you

MohammedXD29 commented 1 year ago

OK

MohammedXD29 commented 1 year ago

So now what I have to do?

Greavesy1899 commented 1 year ago

The XML entries should look like this. Look very carefully.

<LocalisableString StringID="63039103238888">
      <Content Type="String">؟ﻦﺤﻧ ﺍﺬﻫ ﻥﺎﻛ ﻞﻫ</Content>
</LocalisableString>

This is wrong:

<LocalisableString StringID="63039103238888" Name="0" />
      <Content Type="String">؟ﻦﺤﻧ ﺍﺬﻫ ﻥﺎﻛ ﻞﻫ</Content>
</LocalisableString>

It's wrong because:

  1. The name attribute in LocalisableString is not required and will crash MafiaToolkit, so it should be removed.
  2. The slash at the end of LocalisableString is not required because the element ends after <Content Type="String">؟ﻦﺤﻧ ﺍﺬﻫ ﻥﺎﻛ ﻞﻫ</Content> LocalisableString should wrap the element.
MohammedXD29 commented 1 year ago

It's like this : image and if I did what you said it will be like this : image is this normal?

Greavesy1899 commented 1 year ago

Do you mean the missing indentations? That can be solved on your end. Both images look fine to me.

MohammedXD29 commented 1 year ago

Yes, so you mean if it was there or not it won't be a problem, right?

Greavesy1899 commented 1 year ago

It will not be a problem.

MohammedXD29 commented 1 year ago

OK

MohammedXD29 commented 1 year ago

I imported the XML file and no error showed but there's no strings has been changed?

Greavesy1899 commented 1 year ago

Can you show me a picture of the XML and editor

Kamzik123 commented 1 year ago

Did you repack the sds?

MohammedXD29 commented 1 year ago

Did you repack the sds?

No

MohammedXD29 commented 1 year ago

Can you show me a picture of the XML and editor

You mean the XML file and mafia toolkit?

MohammedXD29 commented 1 year ago

Did you repack the sds?

I exported it after import and it's the same

Kamzik123 commented 1 year ago

Repack it after you edit the xbin...

MohammedXD29 commented 1 year ago

OK

Greavesy1899 commented 1 year ago

Did you use the same XML when translating the other strings?

MohammedXD29 commented 1 year ago

Did you use the same XML when translating the other strings?

I noticed right now it wasn't the same 🤕

Greavesy1899 commented 1 year ago

You don't have to export once you have made the changes. You can reuse the same XML.

MohammedXD29 commented 1 year ago

Look... I didn't understand what you mean, but when I import the translated it show me this : image

Greavesy1899 commented 1 year ago

I need to see the XML. It looks like you've caused the same issue as before - incorrect XML markup

MohammedXD29 commented 1 year ago

😅 😅 😅 😅 😅

MohammedXD29 commented 1 year ago

stringtable_en_common_group.txt

Greavesy1899 commented 1 year ago

image

Broken on line 1771.

MohammedXD29 commented 1 year ago

Name="Desk Guard"?

Greavesy1899 commented 1 year ago

The XML entries should look like this. Look very carefully.

<LocalisableString StringID="63039103238888">
      <Content Type="String">؟ﻦﺤﻧ ﺍﺬﻫ ﻥﺎﻛ ﻞﻫ</Content>
</LocalisableString>

This is wrong:

<LocalisableString StringID="63039103238888" Name="0" />
      <Content Type="String">؟ﻦﺤﻧ ﺍﺬﻫ ﻥﺎﻛ ﻞﻫ</Content>
</LocalisableString>

It's wrong because:

1. The name attribute in LocalisableString is not required and will crash MafiaToolkit, so it should be removed.

2. The slash at the end of LocalisableString is not required because the element ends after `<Content Type="String">؟ﻦﺤﻧ ﺍﺬﻫ ﻥﺎﻛ ﻞﻫ</Content>` LocalisableString should wrap the  element.

Exactly the same issue as this.