diff --git a/CMakeLists.txt b/CMakeLists.txt index 782543b..84fff25 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,31 +13,51 @@ set(CMAKE_AUTORCC ON) set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) -find_package(Qt5 COMPONENTS Widgets Multimedia Network REQUIRED) +find_package(Qt5 COMPONENTS Widgets Multimedia Network LinguistTools REQUIRED) find_package(PkgConfig) if (PKG_CONFIG_FOUND) pkg_check_modules(TagLib REQUIRED taglib) endif () +set (PMUSIC_CPP_FILES + main.cpp + mainwindow.cpp + seekableslider.cpp + playlistmodel.cpp + singleapplicationmanager.cpp +) + +set (PMUSIC_HEADER_FILES + mainwindow.h + seekableslider.h + playlistmodel.h + singleapplicationmanager.h +) + +set (PMUSIC_UI_FILES + mainwindow.ui +) + set (EXE_NAME pmusic) -add_executable(${EXE_NAME} - main.cpp - mainwindow.cpp - mainwindow.h - seekableslider.cpp - seekableslider.h - playlistmodel.h - playlistmodel.cpp - singleapplicationmanager.h - singleapplicationmanager.cpp - mainwindow.ui - resources.qrc +# Translation +file (GLOB PMUSIC_TS_FILES languages/*.ts) +set (PMUSIC_CPP_FILES_FOR_I18N ${PMUSIC_CPP_FILES} ${PMUSIC_UI_FILES}) - # 3rd party code - FlacPic.h - ID3v2Pic.h +qt5_create_translation(PMUSIC_QM_FILES ${PMUSIC_CPP_FILES_FOR_I18N} ${PMUSIC_TS_FILES}) + +add_executable(${EXE_NAME} + ${PMUSIC_HEADER_FILES} + ${PMUSIC_CPP_FILES} + ${PMUSIC_UI_FILES} + resources.qrc + + # 3rd party code + FlacPic.h + ID3v2Pic.h + + ${PMUSIC_QM_FILES} ) if (NOT TagLib_FOUND) diff --git a/languages/pineapple-music.ts b/languages/pineapple-music.ts new file mode 100644 index 0000000..6347214 --- /dev/null +++ b/languages/pineapple-music.ts @@ -0,0 +1,34 @@ + + + + + MainWindow + + Mono + + + + Stereo + + + + %1 Channels + + + + Select songs to play + + + + Audio Files + + + + + main + + File list. + + + + diff --git a/languages/pineapple-music_zh_CN.ts b/languages/pineapple-music_zh_CN.ts new file mode 100644 index 0000000..60b1bb0 --- /dev/null +++ b/languages/pineapple-music_zh_CN.ts @@ -0,0 +1,54 @@ + + + + + MainWindow + + Mono + 单声道 + + + Stereo + 立体声 + + + %1 Channels + %1 声道 + + + Select songs to play + 选择要播放的曲目 + + + Audio Files + 音频文件 + + + Pineapple Player + + + + ^ + + + + No song loaded... + 未加载曲目... + + + Drag and drop file to load + 拖放文件来播放 + + + 0:00 + + + + + main + + File list. + 文件列表 + + +