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
run: |
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
shell: bash

View file

@ -91,7 +91,7 @@ if(NOT ANDROID)
find_package(SDL2 REQUIRED)
endif()
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()

View file

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

View file

@ -139,7 +139,7 @@ Requirements (Debian/Ubuntu package names):
- CMake (`cmake`)
- SDL2 (`libsdl2-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`)
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
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)
# to the environment of the linuxdeploy commands

View file

@ -2,7 +2,7 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
add_executable(duckstation-qt
set(SRCS
resources/resources.qrc
aboutdialog.cpp
aboutdialog.h
@ -57,6 +57,14 @@ add_executable(duckstation-qt
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_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>
</QtUi>
</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)')">
<Message Text="Copying common data files" Importance="High" />
<Copy SourceFiles="@(CommonDataFiles)" DestinationFolder="$(BinaryOutputDir)\%(RecursiveDir)" SkipUnchangedFiles="true" />

View file

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

View file

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