Angband Forums

Angband Forums (http://angband.oook.cz/forum/index.php)
-   Development (http://angband.oook.cz/forum/forumdisplay.php?f=10)
-   -   Translate Angband 3.1.0 to other language (http://angband.oook.cz/forum/showthread.php?t=3493)

hernaldo July 19, 2010 04:14

Translate Angband 3.1.0 to other language
 
Hi people,
I have some doubts about to translate the game to other language:

1.- Can I translate Angband to other language? (I compile the source code)

2.- If I finish my tranlation, can i put my nick in the welcome title on load the game?

3.- Can I generate mi own Blog page with the status and other information about the translation? or Am I required to post in this forum? or Both?

4.- What would my product license translated? GPL?

thank and goodbye

Nick July 19, 2010 04:52

In my opinion all of those would be acceptable, and welcome.

hernaldo July 19, 2010 05:12

thanks Nick!!

First problem, my language has accents (for example ), but when i put in the text " it is a test hello " y the screen I only see " it is a test hello" (white space in the "" position)

then, What object i have to modify for get all characteres that i need ?
I seek in the Pref/ font-win.prf but this has not a letters.

some help?

AnonymousHero July 19, 2010 05:51

If you do do this, please use the "gettext" library for it. It is very easy to use and hopefully your changed could be re-integrated back into vanilla Angband for all to benefit from. (NOTE: I don't have any say in this, but "gettext" is minimally disruptive to the code, so I expect it's the approach which has the greatest chance of ever making it into Vanilla. It's also probably less work for you since it can extract strings to translate automatically.)

Basically any time you see
Code:

      println("Hi, this is a text!");
you change it to
Code:

      println(_("Hi, this is a text!"));
The way you translate then, is to provide a language-specific file with strings saying:
Code:

    "Hi, this is a text!" gets translated to "Hej, dette er en tekst!"

Nick July 19, 2010 06:11

Quote:

Originally Posted by hernaldo (Post 37305)
First problem, my language has accents (for example ), but when i put in the text " it is a test hello " y the screen I only see " it is a test hello" (white space in the "" position)

then, What object i have to modify for get all characteres that i need ?
I seek in the Pref/ font-win.prf but this has not a letters.

Angband does not support accented characters at the moment; this may change before too long.

nppangband July 19, 2010 12:55

Quote:

Originally Posted by Nick (Post 37308)
Angband does not support accented characters at the moment; this may change before too long.

I saw a thread once debating the switch from ASCII to unicode. Is that being considered?

I almost have the extended characters from NPP working with the current Angband code base. That could be quickly and easily added (once I get all the bugs worked out).

To answer the original poster's question, over the years Angband has been translated into many languages. Japanese, Russian, and Dutch are three that have been completed. I am not sure what they did about the fonts, however.

Nick July 19, 2010 13:35

Quote:

Originally Posted by nppangband (Post 37309)
I saw a thread once debating the switch from ASCII to unicode. Is that being considered?

I almost have the extended characters from NPP working with the current Angband code base. That could be quickly and easily added (once I get all the bugs worked out).

Yeah, I have it in FA, too.

Takkaria wants to move to UTF-8 (which Wikipedia tells me is unicode...), but last I heard he didn't want to do the extended character stuff. I was planning to include the xchars in AngbandBase, but maybe I should look into UTF-8. The only issue is whether I finish it this lifetime.

konijn_ July 19, 2010 14:08

Quote:

Originally Posted by AnonymousHero (Post 37307)
If you do do this, please use the "gettext" library for it. It is very easy to use and hopefully your changed could be re-integrated back into vanilla Angband for all to benefit from. (NOTE: I don't have any say in this, but "gettext" is minimally disruptive to the code, so I expect it's the approach which has the greatest chance of ever making it into Vanilla. It's also probably less work for you since it can extract strings to translate automatically.)

Basically any time you see
Code:

      println("Hi, this is a text!");
you change it to
Code:

      println(_("Hi, this is a text!"));
The way you translate then, is to provide a language-specific file with strings saying:
Code:

    "Hi, this is a text!" gets translated to "Hej, dette er en tekst!"

Greetings, every time someone mentions translating, someone else mentions gettext and then still someone else says 'Dude, Angband has dozens of language related functions, there's much more to it then just using gettext, in fact gettext might very well annoy future translators instead of helping them."

Gettext is great for static text, most of the text in Angband is dynamically generated which has to take care of declensions, word order typology and other cool stuff.

T.

AnonymousHero July 19, 2010 14:23

Gettext handles dynamic text pretty well too. (Including stuff people usually never think of until it's too late.)

It's still not trivial, but it's much better than trying to maintain a fork in a different language.

EDIT: See this as an example: http://www.gnu.org/s/libc/manual/htm...functions.html

konijn_ July 19, 2010 15:44

Quote:

Originally Posted by AnonymousHero (Post 37315)
Gettext handles dynamic text pretty well too. (Including stuff people usually never think of until it's too late.)

It's still not trivial, but it's much better than trying to maintain a fork in a different language.

EDIT: See this as an example: http://www.gnu.org/s/libc/manual/htm...functions.html

Yes, gettext supports plurals, that wont get you far enough.

Just think how you would approach :

message("You hit the %s with your %s for %s damage." % (target, weapon,
damage))

or ( already more advanced )

message(strings.msg_you_hit % (target, weapon, damage))

It means you would have to provide ( especially for French/German ) the genus of the words and actors in the game just to support those languages or have different calls depending on the player / monster genus ( yuck ! )

There's a dutch guy on the forums sometimes that maintains a Dutch version of Angband, you can ask him more details as to why gettext by itself could be more a hindrance than a benefit.

T.


All times are GMT +1. The time now is 05:08.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.