Review Request 129170: Add KArchive::errorString() method to provide more details on KArchive errors

Friedrich W. H. Kossebau kossebau at kde.org
Sat Oct 15 17:40:42 UTC 2016


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/129170/#review100021
-----------------------------------------------------------



Seems you are the first to add translation features to karchive. So some more things are needed to get translations working:
a) adding a script which enables e.g. the bot "scripty" on the KDE i18n server to extract the strings to translate from the sources, to feed them into the database used by the translators for their work
b) adding code which loads the matching translations at runtime into the Qt translation system, so any calls to tr() will be properly resolved.
c) adding logic to the buildsystem to install any translation files, if existing (added during packaging builds)

For background information see https://techbase.kde.org/Development/Tutorials/Localization/i18n_Build_System and especially the section https://techbase.kde.org/Development/Tutorials/Localization/i18n_Build_Systems#Qt5-only:_Code_using_Qt_translation_system

To get you started, for a) you might want to simply copy from the kcodecs repo the file src/Messages.sh into the same position in karchive. And for b) see the link above and https://api.kde.org/ecm/module/ECMPoQmTools.html which should give you an idea what to do.
For c) you add code like this to the toplevel CMakeLists.txt, compare again to how kcodecs does it:
```
if (IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/po")
    ecm_install_po_files_as_qm(po)
endif()
```

- Friedrich W. H. Kossebau


On Oct. 15, 2016, 3:08 a.m., Romário Rios wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/129170/
> -----------------------------------------------------------
> 
> (Updated Oct. 15, 2016, 3:08 a.m.)
> 
> 
> Review request for KDE Frameworks.
> 
> 
> Repository: karchive
> 
> 
> Description
> -------
> 
> This method is similar to `QIODevice::errorString()`. I added a public `errorString()` method and a protected `setErrorString()` method, to allow `KArchive`'s subclasses to implement their own error messages. I also implemented most error messages from most subclasses.
> 
> 
> Diffs
> -----
> 
>   autotests/karchivetest.cpp d0fbf41 
>   src/k7zip.cpp 692b1db 
>   src/kar.cpp 7204fb1 
>   src/karchive.h b528a4a 
>   src/karchive.cpp a1a160a 
>   src/karchive_p.h 256620d 
>   src/krcc.cpp 1947dd6 
>   src/ktar.cpp f70b155 
>   src/kzip.cpp 94d4276 
> 
> Diff: https://git.reviewboard.kde.org/r/129170/diff/
> 
> 
> Testing
> -------
> 
> I added `QVERIFY` calls after all errors in `karchivetests.cpp`. Perhaps we'll need more tests, but I'm not sure how to make an archive to fail in some specific way aside from the very basics ("file not found", etc.).
> 
> 
> Thanks,
> 
> Romário Rios
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20161015/0f605ea8/attachment.html>


More information about the Kde-frameworks-devel mailing list