Skip to main content

ScummVM translation files

This week there was slow progress on my task. I was also doing some miscellaneous things that related to my task.

The very first thing I want to say: My RTL-GUI PR has been merged into the master branch of ScummVM! Hooray!

Since the previous work was also related to GUI, I had to rebase my branch to even out with master and merge the RTL-GUI work into my own. There were many merge conflicts, but I was able to solve them all! Now that I think about it, merge conflicts are not as scary as I thought they were before. They are pretty simple!

I've set up Travis-CI to build my branch. I did this because continuous building on my machine was very slow, and with Travis, it is very easy to catch up on errors, correct them, and so on. After rewriting history several times, I was able to solve all errors (~50) that didn't appear on my local machine. I use MSVC, so many instances of errors don't appear on my machine - even though it builds and runs completely fine.

This week, criezy has helped me a lot. One of the things I didn't know how to deal with was setting and getting texts from Clipboard for the MacOSX system. The backends use objective-c for this, and I'm not exactly familiar with it. I tried looking up some documentation, but without using it myself in ScummVM, I can only get so far. creizy left some comments and examples in my macOS commits, and I used them to update the code, and MacOS build on Travis was finally successful!

I also had some new things to do this week. ScummVM has a lot of accessibility, with that, it also has many languages available for users. These translations are stored as .po files in a separate folder. ScummVM has dev-tools for developers, and among them is a create_translations tool which generates a binary file from the given PO files. This binary file is then read in ScummVM to properly place translated strings.

I had to convert these PO files to use UTF-8 encoding, and adjust everywhere else when it is being written or read. After I converted the encoding, I changed the create translation tool to accept UTF-8 charset files and generate a new binary file with all the changes. Next, I modified the part where ScummVM reads this binary data.

I did the whole thing rather slowly I would say because I was often confused. At the end of the day, working on it slowly step by step, I was able to display the languages properly!

However, only some languages worked and the others caused a crash. It seemed like the first few languages written in the binary file worked, but after a specific point, it stopped working.

I honestly couldn't figure out what was going wrong. If the first few languages are working, why did others crash? All the languages wrote equivalent data to the file, so I couldn't make sense of it. creizy helped me out with this and pointed me in the right direction. After a while, I still couldn't figure it out. I asked again for some guidance, and creizy asked some questions, gave some hints and it was really a fun way to follow along. In the end, I got what was wrong!

So, at the beginning of the binary file, the tool writes how long does each language last for. In other words, it helps the reading code to jump to the location where a specific language begins.

For greek, this size was around 95519
However, when it was read, it was 29983.

These block sizes are written as an unsigned 16-bit word. But, the size of greek strings - 95519 - in binary was actually 17bits. This caused the highest bit to be lost and the value thus became 29983 in the binary file. I then wrote these block sizes as 32bit words, and the problem was solved!

That's it from me this week. I will see you next time!

Thanks for reading!

Comments

Popular posts from this blog

I got accepted into GSoC!

Hello World GSoC!A start of a wonderful journey, and I'm a part of it! I'm pleased to announce that my proposal has been accepted to GSoC 2020! 
From coding "Hello World", to making small projects, to being a part of ScummVM's GSoC student is fascinating. You know, honestly speaking, I didn't think I would make it. I started my GSoC proposal late, around 19th March. I sent in the first mail to my potential mentor then - and crafting a great proposal usually takes many days. Regardless of the proximity to the deadline, I worked as hard as I could to make a decent proposal, and on 4th May - that hard-work reflected an essential part of my life!
This is my first ever professional experience, and things look a little scary but I have fantastic mentors. Eugene "sev" Sandulenko - the current project lead of ScummVM & John "DJWillis" Willis - team member of ScummVM since 2006. In fact, they're so qualified that it's almost overwhelming! …

My first week experience and my first task!

Hello, it's nice to talk to you again! This is my first week after being accepted into ScummVM and I have a lot to talk about, so let's get started. A little sidenote - Originally, I thought to update my blog once every two weeks and that it would be a good idea, but I just really wanted to update you guys with my exciting first week! 
I was reading my fellow GSoC student's introductory blog post when I realized that the introductory blog post is also meant to introduce a person, something I completely forgot in my first post.
Yes, that's right, I forgot to introduce myself - in my introductory blog post. You read that right - but I hope that you didn't find it rude, I was just really excited to be a part of ScummVM for this summer, and somehow forgot what I was supposed to write! Let's do it right this time before we move on to my first week's experience!

Introduction Hiya! I am Aryan Rawlani, a Computer Science student in Ahmedabad, India. I am 19 years o…

Official coding starts, my first task - polished!

Hello again, it's been a while!


The last time I wrote this, I felt like I was getting pretty close to the completion of my first task. But, whenever I'd complete one thing, another thing popped up and so on and so forth it went.

These past 3 weeks,

- I worked on the positioning of tabs and dialogs which overlapped each other.

- I then worked on some individual widgets and added the support to flip them internally.
Have a look at some of them!

DropDownButtons:

Lists:


Sliders:



These involved majorly working with the XML theme-based layout system that ScummVM uses, and it feels so awesome that all of them now have the support to be viewed as in RTL!
- I worked on extending this RTL based support to the 3 existing themes, as well as extending support for RTL based on the resolution. Have a look!


If you've ever played IGI, this gives some sort of relevance to it. I love this theme, so classy!

I also worked on making the text look right aligned and easy to see for RTL users
While …