Translate Angband 3.1.0 to other language

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hernaldo
    Rookie
    • Jul 2010
    • 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
    Vanilla maintainer
    • Apr 2007
    • 9634

    #2
    In my opinion all of those would be acceptable, and welcome.
    One for the Dark Lord on his dark throne
    In the Land of Mordor where the Shadows lie.

    Comment

    • hernaldo
      Rookie
      • Jul 2010
      • 14

      #3
      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?

      Comment

      • AnonymousHero
        Veteran
        • Jun 2007
        • 1393

        #4
        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!"

        Comment

        • Nick
          Vanilla maintainer
          • Apr 2007
          • 9634

          #5
          Originally posted by hernaldo
          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.
          One for the Dark Lord on his dark throne
          In the Land of Mordor where the Shadows lie.

          Comment

          • nppangband
            NPPAngband Maintainer
            • Dec 2008
            • 926

            #6
            Originally posted by Nick
            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.
            NPPAngband current home page: http://nppangband.bitshepherd.net/
            Source code repository:
            https://github.com/nppangband/NPPAngband_QT
            Downloads:
            https://app.box.com/s/1x7k65ghsmc31usmj329pb8415n1ux57

            Comment

            • Nick
              Vanilla maintainer
              • Apr 2007
              • 9634

              #7
              Originally posted by nppangband
              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.
              One for the Dark Lord on his dark throne
              In the Land of Mordor where the Shadows lie.

              Comment

              • konijn_
                Hellband maintainer
                • Jul 2007
                • 367

                #8
                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.
                * Are you ready for something else ? Hellband 0.8.8 is out! *

                Comment

                • AnonymousHero
                  Veteran
                  • Jun 2007
                  • 1393

                  #9
                  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

                  Comment

                  • konijn_
                    Hellband maintainer
                    • Jul 2007
                    • 367

                    #10
                    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.
                    * Are you ready for something else ? Hellband 0.8.8 is out! *

                    Comment

                    • AnonymousHero
                      Veteran
                      • Jun 2007
                      • 1393

                      #11
                      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.

                      Comment

                      • Magnate
                        Angband Devteam member
                        • May 2007
                        • 5110

                        #12
                        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.
                        "Been away so long I hardly knew the place, gee it's good to be back home" - The Beatles

                        Comment

                        • nppangband
                          NPPAngband Maintainer
                          • Dec 2008
                          • 926

                          #13
                          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.
                          NPPAngband current home page: http://nppangband.bitshepherd.net/
                          Source code repository:
                          https://github.com/nppangband/NPPAngband_QT
                          Downloads:
                          https://app.box.com/s/1x7k65ghsmc31usmj329pb8415n1ux57

                          Comment

                          • Nick
                            Vanilla maintainer
                            • Apr 2007
                            • 9634

                            #14
                            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.
                            One for the Dark Lord on his dark throne
                            In the Land of Mordor where the Shadows lie.

                            Comment

                            • hernaldo
                              Rookie
                              • Jul 2010
                              • 14

                              #15
                              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?

                              Comment

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