Page 8 of 10

Re: Common game translations

Posted: Mon May 25, 2015 1:03 pm
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"...

Re: Common game translations

Posted: Mon May 25, 2015 2:17 pm
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?

Re: Common game translations

Posted: Mon May 25, 2015 2:43 pm
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.

Re: Common game translations

Posted: Mon May 25, 2015 2:44 pm
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).

Re: Common game translations

Posted: Wed May 27, 2015 4:24 pm
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.

Re: Common game translations

Posted: Wed May 27, 2015 8:43 pm
by Positive07
ivan wrote:-snip-
AWESOME! You can totally change the license (it's a nice license).

Re: Common game translations

Posted: Fri Jan 22, 2016 5:43 pm
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

Re: Common game translations

Posted: Sat Jan 23, 2016 8:59 pm
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.

Re: Common game translations

Posted: Sun Jan 24, 2016 9:01 am
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!

Re: Common game translations

Posted: Tue Jan 26, 2016 10:28 am
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"