if ((Player getVariable "SpareTime") > 0) then {...
« New to ArmA 2 (Beta): paramsArrayOn the horizon »


Permalink 08/25/09 17:59, by jonas, Categories: ArmA

CSVtoXML is a converter to convert a stringtable.csv to a stringtable.xml.

The Biki link should explain the stringtable.csv but sadly nothing exists about the stringtable.xml.


The stringtable.xml was introduced in ArmA II. The xml file replaces the stringtable.csv. The stringtable.csv is still supported, but I heard rumour that configs prefer the xml format.


How does it look like?


<?xml version="1.0" encoding="utf-8"?>
<Project name="Arma2">
  <Package name="Modules">
    <Container name="AIS_BC_FA">
      <Key ID="str_agonyTakeOutAction">
        <German>Verletzte evakuieren</German>
      <Key ID="bc_addactions.sqf35">
      <Key ID="carrier.sqf0">
        <German>Tragen beenden</German>
      <Key ID="dragger.sqf0">
        <German>Ziehen beenden</German>

This fragment has been taken from the stringtable.xml in language\Modules from a German ArmA II version.
It is a normal xml-file with a main element named Project. Next elements are Packages. BIS used it as a generic group of the keys. Next element is the Container. This is not required, languagecore\stringtable.xml doesn't use it. But all other files use the Container as a more detailed group. The Container element can be nested.
The next to last element is the Key. This contains the string name which is used by localize.
The last element is the language tag. Each key-element contains an element for each language a translation exists.
In the above code str_agonyTakeOutAction has the German translation "Verletzte evakuieren".
So the Key with id str_agonyTakeOutAction contains an element German with the content "Verletzte evakuieren". To add another translation, e.g. English, we add an element English with content "Take out injured".

So what does CSVtoXML?

As said above: It's convert a stringtable.csv to a stringtable.xml &amp;#59;&amp;#41;



"STR_ION_RTE_BETA_CAPTURE","RTE Capture is required when using the beta version","RTE Capture wird für die Betaversion benötigt","RTE Capture est requis lorsque vous utilisez la version beta"
"STR_ION_RTE_BUGREPORT_TEXT","Bug report:","Fehlerbericht:","Rapport de bug"
"STR_ION_RTE_BUGREPORT_TITLE","Send a bug report","Fehlerbericht senden","Envoyez un rapport de bug"



<?xml version="1.0" encoding="utf-8"?>
<Project name="Arma2">
  <Package name="ION">
    <Container name="RTE">
      <Key name="STR_DN_HE_6G30">
      <Key name="STR_ION_RTE">
      <Key name="STR_ION_RTE_BETA_CAPTURE">
        <English>RTE Capture is required when using the beta
        <German>RTE Capture wird f&#195;&#188;r die Betaversion
        <French>RTE Capture est requis lorsque vous utilisez la
        version beta</French>
        <English>Bug report:</English>
        <French>Rapport de bug</French>
        <English>Send a bug report</English>
        <German>Fehlerbericht senden</German>
        <French>Envoyez un rapport de bug</French>

We can see some details: The Package element contains the OFPEC-tag, the Container element contains the project name.



Comment from: kju [Visitor]
kjuNice post once again!

I am unsure if there is really a reason to convert csv to xml.
CSV are a bit more strict I think it terms of correct definition.

Personally I find the csv easier to handle, if you have few languages.
08/25/09 @ 22:42
Comment from: jonas [Member] Email

As White Angel reported, in some cases it seems like you need to use the stringtable.xml.
But I'm not sure if you can use the $ instead of the @ to fix the problem.

In theory BIS should have made some thoughts before changing the format.
Maybe XML is cooler then CSV ;)
08/25/09 @ 23:07
Comment from: kju [Visitor]
kjuWell if you have many languages, and for non coders,
an xml editor for better usability to add or edit text,
I do see the pros of xml.

Parsing works also.

@ is normally for mission names inside sqm from what I recall.
$STR_ is for anything else.
08/25/09 @ 23:21
Comment from: Chris [Visitor] Email
ChrisThank you very much for the above information! Very helpful, just one thing that confuses me a little. Can you add includes (ex. #include "someNameOfDocument.sqf") to an xml file? Thanks again!
02/01/10 @ 03:55
Comment from: jonas [Member] Email
jonasProbably yes, but I haven't tested it.
02/01/10 @ 22:33
Comment from: MCPXXL [Visitor]

On Windows 7 the tool just close without a comment and on xp i get an error and will be asked to send it to microsoft.

Any idea ?
02/16/10 @ 23:05
Comment from: mikero [Visitor]
mikerounless i misunderstood, the @ $ issue is irrelevent. @ is used only in script, and the engine looks for it's $ equivalent in the csv
03/14/10 @ 16:34