1. Forum moved (you can use login and pass from old forum)
  2. Many discussions moved to the bugtracker

How do I work with STRINGS.XML?

Discussion in 'Translations' started by Solarius Scorch, Aug 5, 2014.

  1. Solarius Scorch

    Solarius Scorch Call to Power modder Global Moderator
    64/112

    Joined:
    Jul 8, 2014
    Messages:
    197
    Likes Received:
    5
    Best Answers:
    0
    OK, so I wanted to start a new language version (Polish), so I went and forked the entire XComApoc project to my own account and now I can edit the STRINGS.XML file.

    ....So, what do I do now?
     
  2. xracer

    xracer Registered
    29/56

    Joined:
    Jul 17, 2014
    Messages:
    44
    Likes Received:
    0
    Best Answers:
    0
    Simply open string.xml in your favorite text editor that supports UTF-8 or in this case your XML editor :) and go wild.

    example
    <string id="STR_UFOPEDIA_TITLE">
    <en_gb>X-COM Apocalypse Ufopedia</en_gb>
    <es_la>Ufopedia X-COM Apocalypse</es_la>
    <po> your translation here </po>
    </string>

    I believe PMProg will the language support in the code to extract the necessary text.
     
  3. pmprog

    pmprog Well-Known Member Official Developer Administrator
    54/56

    Joined:
    Jul 8, 2014
    Messages:
    175
    Likes Received:
    12
    Best Answers:
    0
    I've also just added LANGUAGES/LANGUAGES.XML - please use this to indicate the language code and the localised name of the language

    Thanks

    Also: Stickied topic, so others can see
     
  4. Solarius Scorch

    Solarius Scorch Call to Power modder Global Moderator
    41/56

    Joined:
    Jul 8, 2014
    Messages:
    197
    Likes Received:
    5
    Best Answers:
    0
    Thanks people.

    So, when I have added some strings in my fork, how exactly will it be incorporated to the master - pmprog will pull it?

    What I don't understand is, since this is the same file, how are we supposed to work on it together with xracer and not erase each others' work by overwriting the file?
     
  5. pmprog

    pmprog Well-Known Member Official Developer Administrator
    54/56

    Joined:
    Jul 8, 2014
    Messages:
    175
    Likes Received:
    12
    Best Answers:
    0
    Well, you have to send me a Pull Request first. If everything is fine, then I'll merge it.

    Source control software support merging multiple documents into one. Sometimes it goes a bit awry, but providing you're not altering the complete structure of the document, it should merge easily enough.

    I am wondering whether I should change things though, so it's a seperate document per language (actually, you might already be able to do this)
     
  6. Solarius Scorch

    Solarius Scorch Call to Power modder Global Moderator
    41/56

    Joined:
    Jul 8, 2014
    Messages:
    197
    Likes Received:
    5
    Best Answers:
    0
    OK, thanks.

    Yeah, that would be WAY more comfortable. You wouldn't have to worry about merging every time someone updates their version, which will probably be many, many times a day if there are many languages.

    Or we can use the getlocalization, it's not perfect but at least it's pretty easy to use and control.
     
  7. xracer

    xracer Registered
    29/56

    Joined:
    Jul 17, 2014
    Messages:
    44
    Likes Received:
    0
    Best Answers:
    0
    separate files might be good but this solution is not bad, also i think the merging tool will work well.

    What i personally do i make all the changes to my local file then get the root file and simple cut/paste all the changes and then upload right away so that (hopefully) no changes were made in the short time i was updating the file. So i work in batches make about 4-6 translations, update, submit. :)

    and then i just work of that new file, since there aren't many translation it has been working great :D
     
  8. Solarius Scorch

    Solarius Scorch Call to Power modder Global Moderator
    41/56

    Joined:
    Jul 8, 2014
    Messages:
    197
    Likes Received:
    5
    Best Answers:
    0
    Okay, so ho do I update my fork to incorporate changes from pmprog's master? I can't find the option, and all I found in the help was to run it through the command line, while I'd prefer to do it through the web interface.
     
  9. xracer

    xracer Registered
    29/56

    Joined:
    Jul 17, 2014
    Messages:
    44
    Likes Received:
    0
    Best Answers:
    0
    if you go to the pmprog source and select the string.xml and click on the edit icon (the top right pen icon) this will create a fork for editing and then you can paste all your changes, and create pull request right way.
     
  10. pmprog

    pmprog Well-Known Member Official Developer Administrator
    54/56

    Joined:
    Jul 8, 2014
    Messages:
    175
    Likes Received:
    12
    Best Answers:
    0
    I don't know what you mean by this?

    Anyway, yeah, if you tried creating a file like
    Code:
    <openapoc>
     <string id="ID_NEWGAME">
      <po>New Game In Polish</po>
     </string>
    </openapoc>
    
    I think my code should properly process that, you'd still need to add it to the LANGUAGES.XML, and you'd have to add it as an include into /data/OPENAPOC.XML
     
  11. xracer

    xracer Registered
    29/56

    Joined:
    Jul 17, 2014
    Messages:
    44
    Likes Received:
    0
    Best Answers:
    0
    Please no Getlocalization is not easy and is annoying. Just plain text file is great.
     
  12. Solarius Scorch

    Solarius Scorch Call to Power modder Global Moderator
    41/56

    Joined:
    Jul 8, 2014
    Messages:
    197
    Likes Received:
    5
    Best Answers:
    0
    Well, getlocalization doesn't require any instructions or working with a real code. This is not a problem for me personally, but for many people it would be...

    OK, will do. If I manage to. :p

    For now I'll work locally.

    OK, it's a valid view too... All I'm worrying about is that it might limit our translator base.
     
  13. pmprog

    pmprog Well-Known Member Official Developer Administrator
    54/56

    Joined:
    Jul 8, 2014
    Messages:
    175
    Likes Received:
    12
    Best Answers:
    0
    I still didn't understand. I did a quick search and found out it's a website that "crowdsources" translations, right?
     
  14. xracer

    xracer Registered
    29/56

    Joined:
    Jul 17, 2014
    Messages:
    44
    Likes Received:
    0
    Best Answers:
    0
    Yes openxcom uses it, and is a pain, the voting system that they have is non-existing, the last translation version of the translation will be the regardless of votes.
    There is no way to easily and intuitively search for strings. I mean you can do searches but they do not follow a logical format, I have tried so many times to search for a specific string and is just a test of your patience.
    The system just doesn't work they way is supposed to, it is an annoying tool that doesn't work.

    Then again that is just my opinion.
     
  15. pmprog

    pmprog Well-Known Member Official Developer Administrator
    54/56

    Joined:
    Jul 8, 2014
    Messages:
    175
    Likes Received:
    12
    Best Answers:
    0
    Well, as selfish as it sounds, the game was made in English, and I'm English :)

    Whatever anyone wants to use to translate is purely up to them, I don't mind, because I couldn't understand it anyway
     
  16. Solarius Scorch

    Solarius Scorch Call to Power modder Global Moderator
    41/56

    Joined:
    Jul 8, 2014
    Messages:
    197
    Likes Received:
    5
    Best Answers:
    0
    It's not true, I made many new translated strings for the Openxcom project and most are still on further places, therefore unused by the game.

    I never had any problems whatsoever. You can search by string or by any translation, including the original language.

    I certainly am not writing this just to argue with you, I just need to point out that all the problems you mentioned seem completely non-existent to me. The website never gave me any serious trouble, I always could get what I wanted straight away. All that I didn't like was that it sometimes tended to crash on me, and the democratic system is flawed, but still I found it very handy.

    But if we're not using any external tool, I guess it's a pointless discussion.
     
  17. xracer

    xracer Registered
    29/56

    Joined:
    Jul 17, 2014
    Messages:
    44
    Likes Received:
    0
    Best Answers:
    0
    Maybe you are correct maybe all the issues where in my head, i am very bias against it :)
    but my experience was less than useful
     
  18. DoctorMuerte

    DoctorMuerte Registered
    0/28

    Joined:
    Sep 21, 2014
    Messages:
    7
    Likes Received:
    1
    Best Answers:
    0
    Guys I'm having trouble using github (its my first time using it).

    I made a fork of the proyect, but when I open the file /data/languages/strings.xml it seems like and old version, which only has English and Spanish.

    On the other hand, on pmprog/OpenApoc, the file /data/languages/strings.xml already has French, I don't get it....
     
  19. JonnyH

    JonnyH Well-Known Member Official Developer Administrator
    64/112

    Joined:
    Jul 17, 2014
    Messages:
    183
    Likes Received:
    36
    Best Answers:
    0
    If you fork a project, it takes a 'snapshot' at the point you forked. It doesn't automatically stay up to date.

    You need to regularly 'merge' in new changes from the upstream project - I have no clue how to do that using the github website (if that's possible - there seems to be some instructions here https://help.github.com/articles/merging-branches/ about using the installable gui. I'm an old-school command line guy :)
     
  20. pmprog

    pmprog Well-Known Member Official Developer Administrator
    54/56

    Joined:
    Jul 8, 2014
    Messages:
    175
    Likes Received:
    12
    Best Answers:
    0
    I realise this is a bit old - I don't know if you sorted it, but what I tend to do on projects I've forked, is either delete my repo and refork, or I create a pull request from the original repo which then brings all the latest changes into mine.

    I don't know if the latter is the right way to do things, but it works...
     

Share This Page