Inspiration
This is the first hackathon for two of our members so we wanted to do something lighthearted and fun. We came up with the idea to make a modern English to pirate speech translator.
What it does
The user inputs a word, phrase, or short passage, then the app will display a translated message. For example, "Hello" becomes "Ahoy"
How we built it
We built the app using flutter. We built a thorough conditional system, in which we take two arrays with phrases and their translations. Then we run them through loop changing all recognized parts of the users message.
Custom art assets were developed in Photoshop. We used stack widgets paired with container widgets to place our assets into the app.
Custom music was developed in MuseScore. We implemented this audio using an external audioplayer package. There is an intro song that is played at boot up using the initialize function in flutter. Then we play a small jingle whenever a user translates a message successfully.
Challenges we ran into
We have 148 conditionals. This process was difficult to implement to say the least. What seemed to extremely simple evolved into a great source of problems. To start, at first we used individual conditional statements for each phrase/word. This made debugging slow and adding more conditionals was painful. We also had a problem with smaller words replacing parts of larger words. For example, "This" would get translated using "is" instead of "this" becoming "thbe". We also had the problem of words getting translated and then translated again. For example, "this" became "tis" would get translated again for "is" and become "tbe". The first solution was came up with was to keep the inputted string the same and copy it into an output and adjust the output. This was a problem due to addresses of the strings being different. We tried developing an algorithm to adjust the addresses based on changes in the output. This worked, but had a few edge cases in which it caused out of bounds cases. This was due to the output becoming smaller so we need to subtract to find the right address compared to input. This would break if address - adjustment was less than 0. After multiple iterations we decided to look at a new implementation. In the flutter string documentation we found a function that would replace the first instance of the pattern which helped greatly. After that we would copy input into output and whenever we found a "phrase" we would translate it in output and remove it from input. After that we had a problem in which duplicates would not be translated. We fixed this with a while loop which checked if the message was changed and would rerun until it would not have registered any changes. To fix smaller words we checked for spaces before and after this came with problems within its self. Words at the start,end of the message, period, commas, !, ?, would not translate that message. We added spaces at the end and at the beginning. And at the start we added spaces to periods and ect so that the words would get read. We remove those spaces after.
In terms of the look of the app, we ran into issues regarding cohesion when it came to obtaining assets. Different picture files picked from a plethora of different places did not read well together. The solution was to have almost all of the visual assets in the app drawn from scratch. This brought its own restrictions. One of the many benefits of Flutter is that the widgets allow for code to be applied smoothly to any aspect ratio, however the system is less smooth when dealing with png image assets. The fix for this was to design the art in such a way that there was a certain level of uniformity in the x and y direction to accommodate for stretching or warping when fitting assets to the screen.
The major challenge for the music end of the app was designing a song that conveys the "pirate" feeling in a short amount of time. This was especially challenging since "pirate" music does not use traditional classic music theory. Constructing both songs required thinking outside of traditional boundaries of music. Using unconventional instruments that pirates would have access to (accordion, viola, stamping on the floor, tambourine, etc.) along with a jaunty offbeat percussion section gave off a strong pirate feeling without required to much time investment in the music. This allowed for a solid soundtrack to be developed in under a day. The second challenge was implementing this music. Flutter has many shortcuts for adding assets such as images, so it was originally presumed that Flutter would have a similar shortcut for music. However, we ran into a huge roadblock when we realized Flutter did not actually have a method of implementing music into an app by default. This required a lot of on the spot research on how to use an external library to implement music playing function into this program. After spending far too many hours on this unexpected detour, we eventually got a working soundtrack for this app.
Accomplishments that we're proud of
We are extremely proud of our custom asset for art and music. This made the project truly feel like our own. We are also happy that the app works. Something about seeing all our work come together was tremendously satisfying.
What we learned
Many things we did here were our first time doing so it was very fulfilling. We had very low expectations for our project, and we ended up learning how to implement assets, scaling images, change routes in an app, audio implementation, and team management
What's next for Pirate Translator
We set out with the goal of learning and having fun. We have accomplished those goals. We are going to show family and friends the fun app we made. More importantly, we are going to take the skills we learned for a future of app development. Pirate Translator has inspired use to go further into the field of app development.
Built With
- android-studio
- audioplayers.dart
- dart
- flutter
- musescore
- photoshop




Log in or sign up for Devpost to join the conversation.