Common game translations

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
User avatar
Admicos
Prole
Posts: 8
Joined: Sun Nov 23, 2014 1:41 pm

Re: Common game translations

Post by Admicos »

Did alot of stuff. Skipped video part becuase it was too long for me :D

And i guess somebody alerady translated Territory and Date. (I can't find any names other than mine in contributors place)
User avatar
zorg
Party member
Posts: 3444
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Common game translations

Post by zorg »

I think that the date and territory ones were pulled from another place, so they were -in some sense- already finished :3

Edit: I think i'll add a sheet and mess around with my IPA mapping idea soon...
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
User avatar
Admicos
Prole
Posts: 8
Joined: Sun Nov 23, 2014 1:41 pm

Re: Common game translations

Post by Admicos »

Translated video (skipped a bunch of things i don't know), now translating audio.


(btw why there's 2 "Advanced settings" or similar things. Could'nt there just a General category or someting like that to have multiplied strings?)

EDIT: Stopping at Input. Gonna do some other stuff.
DanielOaks
Prole
Posts: 7
Joined: Tue Aug 05, 2014 1:42 pm

Re: Common game translations

Post by DanielOaks »

I decided to take this and create a Python utility to automagically generate machine-readable files from the Google doc.

Got the repo up here on Github: https://github.com/DanielOaks/common-localizations

It's currently generating .ini files, and I'll probably be looking into some other formats if they would be useful. If you guys have any other formats you think would be useful, please let me know!

Thanks to everyone for the translations, it's very much appreciated!
User avatar
ivan
Party member
Posts: 1911
Joined: Fri Mar 07, 2008 1:39 pm
Contact:

Re: Common game translations

Post by ivan »

Admicos wrote:(btw why there's 2 "Advanced settings" or similar things. Could'nt there just a General category or someting like that to have multiplied strings?)
Admicos, thanks so much for the help!
I'm afraid categorizing things is a little complicated.
Generally speaking, it's good to have several version (with different length or descriptiveness) of the same string:
Hopefully, the categorization will improve as the project grows.

Hey Daniel, good work. :)
BTW, Google docs can export to CSV which is trivial to parse.

In terms of using the files in games, INI is probably the easiest option.
The ".PO" format seems to be popular too.
Of course, you could just export Lua tables or Python arrays too.

By the way, the Unicode database (from which a lot of the strings were imported) is in XML.
XML is very flexible, allowing categorization like:

Code: Select all

<category id="display">
  <word id="resolution">
    <string ver="long">Application display resolution</string>
    <string ver="normal">Display resolution</string>
    <string ver="short">Resolution</string>
  </word>
</category>
On the downside, XML is harder to parse and use in games.

Again, thanks for your interest hopefully the project will get even better over time.
DanielOaks
Prole
Posts: 7
Joined: Tue Aug 05, 2014 1:42 pm

Re: Common game translations

Post by DanielOaks »

Aha, the problem with exporting to CSV is that you can only do one sheet at a time. I don't mind the XLST parsing too much – the Py library I'm using to parse it makes it dirt simple :awesome:

That makes sense, I was thinking about Lua and Py exports as well, throw a simple little package up on PyPi and a simple Lua library that you can drag-and-drop into your application.

I'll look into .PO, since that one does seem popular. XML would probably need to be handled by someone else, since XML and I don't really mix. That said, the code shouldn't be too crazy for someone to implement an XML outputter in, for someone who's done some Python before.

By the way, mind linking to that Unicode database if you've still got a link, ivan? Could be interesting to look into.
User avatar
ivan
Party member
Posts: 1911
Joined: Fri Mar 07, 2008 1:39 pm
Contact:

Re: Common game translations

Post by ivan »

Nice. :)

The following is a summary of what's included in the Unicode database:
http://cldr.unicode.org/cldr-features
A lot of the data is focused on internationalization, for example: currency names, different calendar systems and so on. :)
It's pretty cool although the number of locales in there can be quite overwhealming.
DanielOaks
Prole
Posts: 7
Joined: Tue Aug 05, 2014 1:42 pm

Re: Common game translations

Post by DanielOaks »

Could we add a standard string for something like 'Translation not found', 'No Translation', maybe 'No Translation Found'? I'd like to make that a default value that's returned if the given string is not found in this language.

I'm also working on the Lua library now, will let you guys know once it's at a usable state!

Edit: Got the Lua library working! It's in the repo now.

I've also got an example Love file that prints strings and lets you switch languages. It's not too nice to look at and uses the pretty ugly Unifont, but it does work pretty well!

(Nicer version using the Google Noto font [19MB])

Works for Love 0.9.1
Attachments
CommonLocal.love
(3.41 MiB) Downloaded 135 times
Last edited by DanielOaks on Tue Dec 23, 2014 6:40 pm, edited 1 time in total.
User avatar
ivan
Party member
Posts: 1911
Joined: Fri Mar 07, 2008 1:39 pm
Contact:

Re: Common game translations

Post by ivan »

DanielOaks wrote:Could we add a standard string for something like 'Translation not found', 'No Translation', maybe 'No Translation Found'? I'd like to make that a default value that's returned if the given string is not found in this language.
Good point. Just add it as a string in the online doc. :)
DanielOaks wrote:I'm also working on the Lua library now, will let you guys know once it's at a usable state!
Not a bad start. BTW, I have a little demo lib on the previous page of this thread that shows how to handle $1,$2,$3 flags in Lua.
DanielOaks
Prole
Posts: 7
Joined: Tue Aug 05, 2014 1:42 pm

Re: Common game translations

Post by DanielOaks »

Ah, I missed that one. That's a really cool demo!

As far as $1, $2, $3 flags and all, I might just extend get() with three variables, and if they're not nil it can replace the values in the string before it returns it. Shouldn't cause too much trouble/slowdown.

Edit: I ended up doing it more properly with Lua's ... argument. Just works like this:

Code: Select all

function CommonLocal:get(section, key, ...)
    line = self.strings[section][key]
    if line == '' or line == nil then
        return 'Translation Not Found'
    else
        if ... ~= nil then
            local arg={...}
            for i, replacement in ipairs(arg) do
                line = line:gsub('$' .. i, replacement)
            end
        end
        return line
    end
end
And when you call the get function, you just do something like:

Code: Select all

line = trans:get('audio', 'audio.cardx', 'RealTrack AudioCool 143')
Works pretty well, and I think it's nice and clean
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 223 guests