1
0
mirror of https://github.com/altlinux/admc.git synced 2025-01-22 18:03:57 +03:00

add russian changelog

closes #342
This commit is contained in:
Dmitry Degtyarev 2022-04-05 11:43:40 +04:00
parent 6d0abd0c9d
commit 388e2dcce1
4 changed files with 23 additions and 2 deletions

View File

@ -61,6 +61,7 @@ Tests for ADMC
%files
%doc README.md
%doc CHANGELOG.txt
%doc CHANGELOG_ru.txt
%_bindir/admc
%_libdir/libadldap.so
%_man1dir/admc*

8
CHANGELOG_ru.txt Normal file
View File

@ -0,0 +1,8 @@
admc
CHANGELOG
-----------------------------------------------------------------------
VERSION 0.10.0
-----------------------------------------------------------------------
TODO
русский changelog

View File

@ -48,6 +48,8 @@ add_subdirectory(share)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CHANGELOG.txt
${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CHANGELOG_ru.txt
${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
if (ADMC_BUILD_DEB)
SET(CPACK_GENERATOR "DEB")

View File

@ -39,11 +39,21 @@ ChangelogDialog::ChangelogDialog(QWidget *parent)
const QString fail_text = tr("Failed to open changelog file.");
const QString changelog_path = []() {
const QString changelog_file_name = [&]() {
const QLocale saved_locale = settings_get_variant(SETTING_locale).toLocale();
if (saved_locale.language() == QLocale::Russian) {
return "CHANGELOG_ru.txt";
} else {
return "CHANGELOG.txt";
}
}();
#ifdef QT_DEBUG
return QCoreApplication::applicationDirPath() + "/CHANGELOG.txt";
return QString("%1/%2").arg(QCoreApplication::applicationDirPath(), changelog_file_name);
#endif
return QStandardPaths::locate(QStandardPaths::GenericDataLocation, QString("doc/admc-%1/CHANGELOG.txt").arg(ADMC_VERSION));
return QStandardPaths::locate(QStandardPaths::GenericDataLocation, QString("doc/admc-%1/%2").arg(ADMC_VERSION, changelog_file_name));
}();
if (changelog_path.isEmpty()) {