Conceptualization
As an undergraduate student in the Taiwanese literature department, after completing the Introduction to Computing course, I began to contemplate how I could integrate coding skills with my major studies. Thus, I embarked on this small project, hoping to apply it within my field of study.
Users can choose from five songs to translate, allowing them to listen to music while learning Taiwanese simultaneously.
Code
UI Setting
Using the Tkinter GUI toolkit to create the user interface.
|
|
Designed a window with 400x400 and added a title label, using an EggplantEgg theme for the color scheme (purple-yellow-white). Set the font to Times New Roman.
|
|
When the user selects a song, the computer automatically reads the corresponding CSV file and stores the Chinese and Taiwanese content in two separate arrays.
Language Translation
Users can choose to translate from Chinese to Taiwanese or from Taiwanese to Chinese using a dropdown menu.
Based on the selected translation direction, the range of choices is set using the contents of value1 and value2.
After clicking the confirm button, a dropdown menu is generated to select the sentence to be translated.
|
|
|
|
After the user selects the sentence they wish to translate, the corresponding lyrics are located based on their choice and then translated. Depending on the chosen method of translation, the selected lyrics are translated and the results are displayed on the interface.
While listening to the 2022 Golden Melody Awards Song of the Year, one can also take the opportunity to learn Romanized phonetics. This not only enhances understanding of the lyrics but also improves language skills and cultural knowledge 😊