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
ivan
Party member
Posts: 1915
Joined: Fri Mar 07, 2008 1:39 pm
Contact:

Re: Common game translations

Post by ivan »

Hey BozoDel,
On first glance, seems like "one" and "other" should cover
all the locales on the page (except for Arabic which has no contributors at the moment).
But you're right, if some locales requires additional options, it shouldn't be too hard to add "zero", "two", "few" and "many".
In practice, the 5-6 major languages are more than enough for translating any game and these use strictly "one" and "other".

PS. Correction, Russian, Ukrainian and Polish require "few" and "many"...
User avatar
T-Bone
Inner party member
Posts: 1492
Joined: Thu Jun 09, 2011 9:03 am

Re: Common game translations

Post by T-Bone »

I think I'm missing something... What's the purpose of this? Isn't a translation something you'd want to do uniquely for each game? When would a generic translation table actually be useful?
User avatar
s-ol
Party member
Posts: 1077
Joined: Mon Sep 15, 2014 7:41 pm
Location: Cologne, Germany
Contact:

Re: Common game translations

Post by s-ol »

T-Bone wrote:I think I'm missing something... What's the purpose of this? Isn't a translation something you'd want to do uniquely for each game? When would a generic translation table actually be useful?
it contains strings that every game can use, like "game over", "score" etc.

s-ol.nu /blog  -  p.s-ol.be /st8.lua  -  g.s-ol.be /gtglg /curcur

Code: Select all

print( type(love) )
if false then
  baby:hurt(me)
end
User avatar
ivan
Party member
Posts: 1915
Joined: Fri Mar 07, 2008 1:39 pm
Contact:

Re: Common game translations

Post by ivan »

Yes, you're right of course.

Although some of the UI in games can be generalized in particular:
-menus, settings, saving, hiscores, profiles, etc
-error messages
-text involving time, dates, countries, etc
Some genres of games have standard terminology:
-board games like chess, backgammon, etc
-card games like solitaire, poker, etc

Of course this wouldn't work if there is context involved (dialog and story).
The purpose was to see what terminology can be generalized/reused.
So if you want to have your game translated, just add it as
another sheet (called "platformer" for example).
User avatar
ivan
Party member
Posts: 1915
Joined: Fri Mar 07, 2008 1:39 pm
Contact:

Re: Common game translations

Post by ivan »

Just a small update on the project.
Since the size of the spreadsheet has grown considerably,
I'm removing completed sections and storing them in this repository:
https://bitbucket.org/itraykov/cgl/src
Completed translations and static data (like territories) don't change much plus it
would make it slightly easier to use the spreadsheet.
Thanks again to everyone who has contributed!

Note that I've exported some of the data to Lua:
For example, cgl/src/calendar/Lua/formatRelative.lua
could be used alongside with kikito's pluralization lib to display relative time.
Also, I propose changing the license to zlib if nobody is too upset.
User avatar
Positive07
Party member
Posts: 1014
Joined: Sun Aug 12, 2012 4:34 pm
Location: Argentina

Re: Common game translations

Post by Positive07 »

ivan wrote:-snip-
AWESOME! You can totally change the license (it's a nice license).
for i, person in ipairs(everybody) do
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
User avatar
ivan
Party member
Posts: 1915
Joined: Fri Mar 07, 2008 1:39 pm
Contact:

Re: Common game translations

Post by ivan »

Hey, this project has been great and thanks to your help and support we've collected a lot of useful data.

In another thread, Zorg has mentioned what a headache it is to deal with calendars so I would like to share a small library.
Instead of using calendars, it's MUCH easier to just use relative periods of time, ex: "5 days ago" or "2 minutes from now".
Relative dates are easier to translate, localize and understand by users!

Let's look at how the library works:

Code: Select all

local timediff = require("utils.lang.timediff")

timediff ('en', 60*60*23) -- output: "in 23 hours"
timediff ('en', -60*60*23) -- output: "23 hours ago"
timediff ('en', -60*60*24) -- output: "1 day ago"
timediff ('en', -60*60*24*30*12, "days") -- output: "350 days ago"

timediff ('ru', 60*60*24*5 ) -- Через 5 день
-- the function returns utf8 strings so make sure your font supports those characters
That's it!
API:

Code: Select all

-- returns a relative period, ex: "1 minute ago, in 1 minute, in 2 minutes, in 5 minutes"
function timediff(locale, timeDiff [, units ])
So there you have it, the library comes packed with a database of hundreds of locales.

Credits:
- kikito's pluralization library
- the unicode database
- all of you for your help with the translation project
Attachments
timediff.love
bugfixes and cleanup
(2.83 MiB) Downloaded 103 times
Last edited by ivan on Tue Jan 26, 2016 10:27 am, edited 2 times in total.
User avatar
zorg
Party member
Posts: 3465
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Common game translations

Post by zorg »

Hey Ivan,

First, nice work on this awesome little lib! (Though it won't deter me from trying to come up with something else still! : )

Second, i have a question; running your relative time test lua made me aware of a small-ish issue, namely that i used unnecessarily long phrasing in at least the "second ago" field; if one wanted to change some fields in already "completed" sections, could, and should they do it by submitting pull requests to the bitbucket repo?

Also, i filled in some more gaps in the spreadsheet.
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
ivan
Party member
Posts: 1915
Joined: Fri Mar 07, 2008 1:39 pm
Contact:

Re: Common game translations

Post by ivan »

Hey thanks, it's a work-in-progress so there are some bugs in there.
For example, I just noticed that "utils/lang/inter.lua":190 if Y ~= 0 and abs(M) > 3 then -- Y must be uppercase
Also, in the future it would be nice to add "duration" which looks like: "3 seconds", "1 second" (without the "ago").

Yep sure, if you have any fixes and improvements, we'll add them to the repo.

The latest Lua code is available in the "utils" repo: https://bitbucket.org/itraykov/utils/src/master/lang/
The translation data is in "CGL": https://bitbucket.org/itraykov/cgl/src/master/calendar

Note that a lot of the data is from Unicode and their database has changed since the last time the repo was updated.
In the future, it might be wise to limit the data to 20-30 locales so things don't get out of hand.

Thanks so much for the help!
User avatar
ivan
Party member
Posts: 1915
Joined: Fri Mar 07, 2008 1:39 pm
Contact:

Re: Common game translations

Post by ivan »

Just updated and refactored the relative time lib.

Code: Select all

timediff = require("utils.lang.timediff") -- includes the library

Code: Select all

dependecies:
utils/lang/plural.lua <-- pluralization
utils/lang/data/period.lua <-- database with ~100 locales
It's now much smaller and easier to use.

List formatting utility included:

Code: Select all

list = require("utils.lang.list")

list("en", {1}) -- outputs: "1"
list("en", {1, 2}) -- outputs: "1 and 2"
list("en", {1,2,3}) -- outputs: "1, 2 and 3"
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 11 guests