Translate Angband 3.1.0 to other language

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • hernaldo
    replied
    Ok thanks!
    I'm going to try modify the code. But I've a questions becouse this lines i don't find in the FA or NPPAngband code:

    typedef struct xchar_type xchar_type;
    T->xchar_hook
    what mean "typedef struct xchar_type xchar_type;" and "T->xchar_hook"
    are an error?
    Last edited by hernaldo; July 22, 2010, 05:18.

    Leave a comment:


  • nppangband
    replied
    Originally posted by hernaldo
    Well, i have two options:
    Translate FA, I make a couple of tests and it works!, y can put tildes (á) in the text game (for example birth.c), but not in the welcome screen (news.txt), but at least it's a breakthrough.

    Or

    someone help me to include xchar into Angband, and here i ask:
    nppangband remember these functions?

    regards!
    encode_to_xchar
    get_encode
    xchar_trans_hook
    static const xchar_type latin1_encode
    byte char_tables[256][CHAR_TABLE_SLOTS]
    xstr_trans
    escape_latin1
    typedef struct xchar_type xchar_type;
    my_toupper (there is a whole series of these in z-form.h...my_tolower, my_isprint, my_isspace are examples. )
    T->xchar_hook

    You also have to grab the fonts from NPPAngband (in lib/xtra/font), because those have the extended characters in them.

    But with all that, I am missing something. Because it only displays the extended characters if a message is formatted instead of printing it directly. For example, in the knowledge screen, where it uses c_put_str, it displays ['e] instead of the accented e. So I am missing a tiny part of the patch, which is why I want to find a copy of the original part of the patch so badly. I will let you know when I find it.

    Leave a comment:


  • hernaldo
    replied
    Well, i have two options:
    Translate FA, I make a couple of tests and it works!, y can put tildes (á) in the text game (for example birth.c), but not in the welcome screen (news.txt), but at least it's a breakthrough.

    Or

    someone help me to include xchar into Angband, and here i ask:
    nppangband remember these functions?

    regards!

    Leave a comment:


  • nppangband
    replied
    Originally posted by hernaldo

    Second: my native language is Spanish, ASCII symbols besides, I just need these eight special symbols:
    á, é, í, ó, ú, ń, ˇ, ż

    Is necesary to use UTF-8 for handling it? or there are other way?

    Third: what object I can start to see in the source code for modify the encoding o Ascci symbols to add this 8 symbols?
    We are talking about an extended character patch that offers 256 characters instead of the standard ASCII that Angband currently uses. It has the 8 characters you are looking for.

    The patch has been long lost, but the code can be found in FAAngband, Sangband and NPPAngband and I am sure a couple others. Just GREP the source for the following: xchar, latin1, my_toupper, my_tolower... and you will find everything you need. THere are about 5-6 functions that need to be added and called in a couple select parts of the source code.

    This patch is a workaround. You can't type an accented character directly in a file and have it procesed. Instead you have to put in a special code, like ['e] and it types out é for systems that can handle it, and e for those older systems that can only use ASCII.

    By the way, if anyone does have a copy of the extended character patch that we made, I would greatly appreciate a copy. Leon Marrick had it on his server, but that is down. I lost my copy when an older computer I stored it on had a meltdown.

    Leave a comment:


  • ekolis
    replied
    As long as the game never refers to years... if you remove the tilde from the ń in ańo, you get abominations like "I have twenty-six anuses" instead of "I am twenty-six years old"!

    Leave a comment:


  • Nick
    replied
    Originally posted by hernaldo
    Wow, a lot of information for a newie as me!
    Some of us here don't always stick to the topic...

    First: what is FA?
    FAangband (short for First Age Angband is a variant, which I maintain.

    Second: my native language is Spanish, ASCII symbols besides, I just need these eight special symbols:
    á, é, í, ó, ú, ń, ˇ, ż

    Is necesary to use UTF-8 for handling it? or there are other way?
    The other (quicker, but less neat) way of handling it is the extended characters (xchars) which have been mentioned. They are used in some variants, but not in Angband itself.

    Third: what object I can start to see in the source code for modify the encoding o Ascci symbols to add this 8 symbols?
    You will really need either xchar or UTF-8 support for this. I would recommend that you start by just using the unaccented characters (I'm not sure how badly that effects the meaning in Spanish), and then change over once there is some support for accented characters in Angband.

    Leave a comment:


  • buzzkill
    replied
    Without going crazy with the source code, you could just create a custom font with a font editor. I'm sure you could find 8 characters that are never used and change them into the ones you need. Probably not the best solution, but certainly doable.

    Leave a comment:


  • hernaldo
    replied
    Wow, a lot of information for a newie as me!

    First: what is FA?

    Second: my native language is Spanish, ASCII symbols besides, I just need these eight special symbols:
    á, é, í, ó, ú, ń, ˇ, ż

    Is necesary to use UTF-8 for handling it? or there are other way?

    Third: what object I can start to see in the source code for modify the encoding o Ascci symbols to add this 8 symbols?

    Leave a comment:


  • Nick
    replied
    I'm inclined to favour the "include xchars as a quick fix, but aim to move to UTF-8 asap" approach, but I agree we need takkaria's approval on the first bit of that. From my personal point of view, I would like to add xchars to the AngbandBase code (as I'm planning to incorporate that into FA, and I don't want to remove xchars from FA); however I want AngbandBase to remain aligned with V. So I'm going to do unconnected stuff (or possibly nothing ) on AngbandBase until the situation clarifies.

    As to unicode handling - I'm guessing pretty much everything can deal with it, but only guessing.

    Leave a comment:


  • nppangband
    replied
    Originally posted by Nick
    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.
    That would be good. The extended character patchis a workaround to allows extended characters on the systems that could handle them, but made sure that systems that could only handle the standard ASCII set weren't left out. If we go to unicode they are completely unnecessary.

    Are there any systems supported by Angband that can't handle unicode?

    If Takkaria opts against unicode and does want the extended character patch, it would probably take me about 15 minutes to add it. I will be happy to take that on if a ticket is added. The hard part when we made the patch was we had to create our own fonts, since Angband was still under the old moria license. Now that it is open source/GPL, I am sure there are many other size fonts we can add.

    Leave a comment:


  • Magnate
    replied
    Originally posted by Nick
    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.
    Hmmm. I can't find any tickets about this issue, but I'm pretty sure I recall discussion on angband-dev about this. There's a vague and unformulated plan to re-do all the text generation functions - primarily for better formatting and paging, but major secondary reasons are small screen support for mobile devices, and translation.

    I guess it's a big enough issue that it needs a steer from Takkaria on his views / intentions etc. Personally I don't see any point redoing text functions for one reason (say, supporting different screen sizes) without also accommodating translation. But it's a lot of work.

    Leave a comment:


  • AnonymousHero
    replied
    Maybe I'm missing something, but aren't you going to need to handle those cases either way? Gettext still makes the easy cases easy...

    Oh well, it was just a suggestion.

    Leave a comment:


  • konijn_
    replied
    Originally posted by AnonymousHero
    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.

    Leave a comment:


  • AnonymousHero
    replied
    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

    Leave a comment:


  • konijn_
    replied
    Originally posted by AnonymousHero
    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.

    Leave a comment:

Working...
😀
😂
🥰
😘
🤢
😎
😞
😡
👍
👎