Qt: Add Portuguese translation

This commit is contained in:
Connor McLaughlin 2020-07-28 19:16:12 +10:00
parent 3edb255eca
commit 79c8b9f52c
11 changed files with 1520 additions and 7 deletions

View File

@ -93,7 +93,7 @@ jobs:
shell: bash shell: bash
run: | run: |
sudo apt-get update sudo apt-get update
sudo apt-get -y install cmake ninja-build ccache libsdl2-dev libgtk2.0-dev qtbase5-dev qtbase5-dev-tools qtbase5-private-dev qt5-default sudo apt-get -y install cmake ninja-build ccache libsdl2-dev libgtk2.0-dev qtbase5-dev qtbase5-dev-tools qtbase5-private-dev qt5-default qttools5-dev
- name: Compile build - name: Compile build
shell: bash shell: bash

View File

@ -91,7 +91,7 @@ if(NOT ANDROID)
find_package(SDL2 REQUIRED) find_package(SDL2 REQUIRED)
endif() endif()
if(BUILD_QT_FRONTEND) if(BUILD_QT_FRONTEND)
find_package(Qt5 COMPONENTS Core Gui Widgets Network REQUIRED) find_package(Qt5 COMPONENTS Core Gui Widgets Network LinguistTools REQUIRED)
endif() endif()
endif() endif()

View File

@ -5,6 +5,9 @@ The following people have contributed to the project in some way, and are credit
- Connor McLaughlin - @stenzek - Connor McLaughlin - @stenzek
- @ggrtk - @ggrtk
## Translators
- Anderson Cardoso - Portuguese
## Game Compatibility Database ## Game Compatibility Database
- @Zet-sensei - @Zet-sensei
- @DarkFrost89 - @DarkFrost89

View File

@ -139,7 +139,7 @@ Requirements (Debian/Ubuntu package names):
- CMake (`cmake`) - CMake (`cmake`)
- SDL2 (`libsdl2-dev`) - SDL2 (`libsdl2-dev`)
- GTK2.0 for file selector (`libgtk2.0-dev`) - GTK2.0 for file selector (`libgtk2.0-dev`)
- Qt 5 (`qtbase5-dev`, `qtbase5-private-dev`, `qtbase5-dev-tools`) - Qt 5 (`qtbase5-dev`, `qtbase5-private-dev`, `qtbase5-dev-tools`, `qttools5-dev`)
- Optional for faster building: Ninja (`ninja-build`) - Optional for faster building: Ninja (`ninja-build`)
1. Clone the repository. Submodules aren't necessary, there is only one and it is only used for Windows. 1. Clone the repository. Submodules aren't necessary, there is only one and it is only used for Windows.

View File

@ -48,6 +48,15 @@ for frontend in ${FRONTENDS[@]}; do
cp -av ${DATA_DIR}/* ${CURRENT_APPDIR}/usr/bin cp -av ${DATA_DIR}/* ${CURRENT_APPDIR}/usr/bin
done done
# Add translations into the AppDir.
TRANSLATIONS_DIR=${BUILD_DIR}/bin/translations
echo "Translation directory is: ${BUILD_DIR}"
for frontend in ${FRONTENDS[@]}; do
CURRENT_APPDIR=${BUILD_DIR}/AppDir-duckstation-${frontend}
mkdir -p ${CURRENT_APPDIR}/usr/bin
cp -av ${TRANSLATIONS_DIR} ${CURRENT_APPDIR}/usr/bin
done
# Pass UPDATE_INFORMATION and OUTPUT variables (used by linuxdeploy-plugin-appimage) # Pass UPDATE_INFORMATION and OUTPUT variables (used by linuxdeploy-plugin-appimage)
# to the environment of the linuxdeploy commands # to the environment of the linuxdeploy commands

View File

@ -2,7 +2,7 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON) set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON) set(CMAKE_AUTOUIC ON)
add_executable(duckstation-qt set(SRCS
resources/resources.qrc resources/resources.qrc
aboutdialog.cpp aboutdialog.cpp
aboutdialog.h aboutdialog.h
@ -57,6 +57,14 @@ add_executable(duckstation-qt
settingsdialog.ui settingsdialog.ui
) )
set(TS_FILES
translations/duckstation-qt_pt.ts
)
set_source_files_properties(${TS_FILES} PROPERTIES OUTPUT_LOCATION "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/translations")
qt5_add_translation(QM_FILES ${TS_FILES})
add_executable(duckstation-qt ${SRCS} ${QM_FILES})
target_include_directories(duckstation-qt PRIVATE "${Qt5Gui_PRIVATE_INCLUDE_DIRS}") target_include_directories(duckstation-qt PRIVATE "${Qt5Gui_PRIVATE_INCLUDE_DIRS}")
target_link_libraries(duckstation-qt PRIVATE frontend-common core common imgui glad minizip scmversion vulkan-loader Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Network) target_link_libraries(duckstation-qt PRIVATE frontend-common core common imgui glad minizip scmversion vulkan-loader Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Network)

View File

@ -179,6 +179,11 @@
<FileType>Document</FileType> <FileType>Document</FileType>
</QtUi> </QtUi>
</ItemGroup> </ItemGroup>
<ItemGroup>
<QtTs Include="translations\duckstation-qt_pt.ts">
<FileType>Document</FileType>
</QtTs>
</ItemGroup>
<Target Name="CopyCommonDataFiles" AfterTargets="Build" Inputs="@(CommonDataFiles)" Outputs="@(CommonDataFiles -> '$(BinaryOutputDir)%(RecursiveDir)%(Filename)%(Extension)')"> <Target Name="CopyCommonDataFiles" AfterTargets="Build" Inputs="@(CommonDataFiles)" Outputs="@(CommonDataFiles -> '$(BinaryOutputDir)%(RecursiveDir)%(Filename)%(Extension)')">
<Message Text="Copying common data files" Importance="High" /> <Message Text="Copying common data files" Importance="High" />
<Copy SourceFiles="@(CommonDataFiles)" DestinationFolder="$(BinaryOutputDir)\%(RecursiveDir)" SkipUnchangedFiles="true" /> <Copy SourceFiles="@(CommonDataFiles)" DestinationFolder="$(BinaryOutputDir)\%(RecursiveDir)" SkipUnchangedFiles="true" />

View File

@ -41,17 +41,20 @@
<ClCompile Include="$(IntDir)moc_memorycardsettingswidget.cpp" /> <ClCompile Include="$(IntDir)moc_memorycardsettingswidget.cpp" />
<ClCompile Include="$(IntDir)qrc_resources.cpp" /> <ClCompile Include="$(IntDir)qrc_resources.cpp" />
<ClCompile Include="inputbindingdialog.cpp" /> <ClCompile Include="inputbindingdialog.cpp" />
<ClCompile Include="$(IntDir)moc_inputbindingdialog.cpp" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="qtutils.h" /> <ClInclude Include="qtutils.h" />
<ClInclude Include="settingwidgetbinder.h" /> <ClInclude Include="settingwidgetbinder.h" />
<ClInclude Include="resource.h" /> <ClInclude Include="resource.h" />
<ClInclude Include="inputbindingdialog.h" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Filter Include="resources"> <Filter Include="resources">
<UniqueIdentifier>{3b2587ae-ce3b-4eb5-ada2-237e853620cf}</UniqueIdentifier> <UniqueIdentifier>{3b2587ae-ce3b-4eb5-ada2-237e853620cf}</UniqueIdentifier>
</Filter> </Filter>
<Filter Include="translations">
<UniqueIdentifier>{4230e20b-2aff-4c86-966c-b620263a371d}</UniqueIdentifier>
</Filter>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<QtResource Include="resources\resources.qrc" /> <QtResource Include="resources\resources.qrc" />
@ -75,6 +78,7 @@
<QtMoc Include="controllersettingswidget.h" /> <QtMoc Include="controllersettingswidget.h" />
<QtMoc Include="aboutdialog.h" /> <QtMoc Include="aboutdialog.h" />
<QtMoc Include="memorycardsettingswidget.h" /> <QtMoc Include="memorycardsettingswidget.h" />
<QtMoc Include="inputbindingdialog.h" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<QtUi Include="consolesettingswidget.ui" /> <QtUi Include="consolesettingswidget.ui" />
@ -87,6 +91,7 @@
<QtUi Include="advancedsettingswidget.ui" /> <QtUi Include="advancedsettingswidget.ui" />
<QtUi Include="gamepropertiesdialog.ui" /> <QtUi Include="gamepropertiesdialog.ui" />
<QtUi Include="aboutdialog.ui" /> <QtUi Include="aboutdialog.ui" />
<QtUi Include="inputbindingdialog.ui" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Natvis Include="qt5.natvis" /> <Natvis Include="qt5.natvis" />
@ -98,6 +103,11 @@
<Image Include="duckstation-qt.ico" /> <Image Include="duckstation-qt.ico" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="inputbindingdialog.ui" /> <QtTs Include="translations\duckstation-qt_de.ts" />
</ItemGroup>
<ItemGroup>
<None Include="translations\duckstation-qt_pt.ts">
<Filter>translations</Filter>
</None>
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -53,7 +53,7 @@ const char* QtHostInterface::GetFrontendName() const
std::vector<std::pair<QString, QString>> QtHostInterface::getAvailableLanguageList() std::vector<std::pair<QString, QString>> QtHostInterface::getAvailableLanguageList()
{ {
return {{QStringLiteral("English"), QStringLiteral("")}}; return {{QStringLiteral("English"), QStringLiteral("")}, {QStringLiteral("Portuguese"), QStringLiteral("pt")}};
} }
bool QtHostInterface::Initialize() bool QtHostInterface::Initialize()

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,2 @@
..\..\dep\msvc\qt\5.15.0\msvc2017_64\bin\lupdate.exe ./ -ts translations\duckstation-qt_pt.ts
pause