Translation of data files?

Posts

[Unknown user]'s Avatar
IBBoard
Administrator, Commissar
Administrator
Commissar
Progress to next rank:
 
38%
 
Posts: 4222
Joined: 20 Mar 2001, 20:24
Location: Worcestershire, UK

Translation of data files?

Postby IBBoard at 23 Jun 2008, 21:13

I'm just working on some pages for the developer's section of the website and suddenly had a thought about translation with regards data files.

When it comes to the GUI, I already know that English-speaking developers have a bad habit of ignoring translations. For that reason I coded in translations from the start (although I do sometimes get lazy and go "I'll hard-code it for now and translate later", but the functionality is there). What I just realised is that this wouldn't help with data files.

Now, as I see it there are three alternatives:

1) Each language has their own version of the game system/race data file that has the names of units using their translated version. Plus side is that each translation is entirely independent (you aren't relying on the English version to be able to create the French version). Minus side is that you duplicate data and a mistake in one could be left in another.

2) There is only one data file and the name of a unit type (for example) contains multiple "names", each tagged with a language. Plus side is that you can fall back to a default English (like the UI translations) and that all nationalities only need one data file, so data won't be out of synch between languages. Minus side is that it leaves any translators all fighting over one data file.

3) Probably the most complicated. There is one data file with the name of each unit in English. The data file (now being a zip, which means it can hold multiple files) also has translation files for each language (e.g. fr.translation, de.translation, nl.translation, etc). Plus side is that you again get the fall back to a default English and that this time each nationality gets their own file to update. Minus side is that it could be quite a bit more complex to implement.

So, which way do people think would be the best way to do translations of game data? Any other thoughts or suggestions?
Out now: Dawn of War Texture/Skin Downloads
At v0.1: WarFoundry (open source, cross-platform, multi-system army creation application)

[Unknown user]'s Avatar
stfas
Advanced Member
Advanced Member
Progress to next rank:
 
85%
 
Posts: 277
Joined: 03 Jul 2007, 10:17

Re: Translation of data files?

Postby stfas at 23 Jun 2008, 23:44

i think 3 would be the best...

[Unknown user]'s Avatar
IBBoard
Administrator, Commissar
Administrator
Commissar
Progress to next rank:
 
38%
 
Posts: 4222
Joined: 20 Mar 2001, 20:24
Location: Worcestershire, UK

Re: Translation of data files?

Postby IBBoard at 24 Jun 2008, 19:19

Yeah, the awkward and complex one is normally the best :D I guess it's just a case of working out how to do it, how to make it easy for users to understand, and how to maintain credits (because I know people will want them).
Out now: Dawn of War Texture/Skin Downloads
At v0.1: WarFoundry (open source, cross-platform, multi-system army creation application)

[Unknown user]'s Avatar
Tsudico
New blood
New blood
Progress to next rank:
 
60%
 
Posts: 30
Joined: 20 Jan 2008, 16:25

Re: Translation of data files?

Postby Tsudico at 26 Jun 2008, 08:13

Well, I don't know if the following would work, but why not have the data file separate from all the languages, including English. You have a Unit_ID for each unit, and use a key/value pair linking Unit_ID with the translations of the unit in the separate language files. In this case, the value of the pair would be all the translations needed for that unit.

Code: Select all
class Unit {
   Unit_ID
   Unit_Name
   Unit_Description
   ...
}

Code: Select all
lang.en
author:"John Smith"
/* ID : Name | Description */
01:"Firewarrior|Basic troop of the Tau Army..."

As you can see in the language files you could have additional data, such as author:"John Smith"

[Unknown user]'s Avatar
IBBoard
Administrator, Commissar
Administrator
Commissar
Progress to next rank:
 
38%
 
Posts: 4222
Joined: 20 Mar 2001, 20:24
Location: Worcestershire, UK

Re: Translation of data files?

Postby IBBoard at 26 Jun 2008, 18:13

Each unit has a UnitID anyway, which I was going to use for the translations as it will already be used for relationships (e.g. requirements) between units.

The reason I want an English* is that forcing a name etc in the data file makes it less likely that people will get in to the situation where they don't have names. It's also easier logic, easier to explain and more flexible to do a fall-back to "text in data file" rather than "fall back to en, unless it doesn't exist, at which point do something else".

Thanks for the feedback, though.


* or other language, but normally English - I guess the sensible method would be to do a "lang=..." attribute at the top of the file to define what the default language for the file is.
Out now: Dawn of War Texture/Skin Downloads
At v0.1: WarFoundry (open source, cross-platform, multi-system army creation application)

[Unknown user]'s Avatar
stfas
Advanced Member
Advanced Member
Progress to next rank:
 
85%
 
Posts: 277
Joined: 03 Jul 2007, 10:17

Re: Translation of data files?

Postby stfas at 27 Jun 2008, 00:14

as english is one of the biggest languages in the world its pretty much the main language of almost all things...

[Unknown user]'s Avatar
Tsudico
New blood
New blood
Progress to next rank:
 
60%
 
Posts: 30
Joined: 20 Jan 2008, 16:25

Re: Translation of data files?

Postby Tsudico at 27 Jun 2008, 00:48

The only reason I suggested completely separate language files was because I thought it may make it easier overall to program and/or change. I can definitely see the advantage of one language included in the data file. Is the data file going to be in a binary or textual format? If textual, such as XML, then it may be better to include the language information mixed in with the data. If it is just binary, then the actual format of the data file would be more up to the programmer instead of the user.

[Unknown user]'s Avatar
IBBoard
Administrator, Commissar
Administrator
Commissar
Progress to next rank:
 
38%
 
Posts: 4222
Joined: 20 Mar 2001, 20:24
Location: Worcestershire, UK

Re: Translation of data files?

Postby IBBoard at 27 Jun 2008, 13:02

The standard data files will be XML wrapped in a Zip to allow for a couple of extra niceties (such as icons - see the website or one of the other threads for more on that) so embedded text isn't a problem and makes sense. The design is such that people will be able to write their own plugins that handle different formats such as binary, though.

I've even been putting a little bit of thought in to how I can work the file loading to support loading of files such as Rollcall so that there's an existing body of data files already. If someone can reverse engineer Army Builder and Games Workshop's data file formats then there would be the potential to use those as well.

Stfas: Yes, English is the main language on the Net (mainly because us Brits and the Americans are lazy when it comes to other languages and so everyone else learns English/American to be able to take advantage of the markets) but that doesn't mean it should be fixed. I know a lot of non-English speakers can be locked out by an app assuming English is understood, so allowing any language as a default seems like a good idea :)
Out now: Dawn of War Texture/Skin Downloads
At v0.1: WarFoundry (open source, cross-platform, multi-system army creation application)