Hi all,
those of you who have been here for a long time might recall that when I
joined the community I assumed that my tasks would be only two: backport
patches to the stable TDE series and work on translation. Over time, it
turned out that my tasks on the project would be bigger. However, work
on translations is still a postponed task.
Recently, I have devoted some time to the tasks that are essential to move
us forward with the work on translations. Therefore, I would like to
inform you about the results and related plans.
I apologize for long email.
1. Unnecessary updates of POT files during package build
I observed that during the DEB packages build, an attempt was made to
update POT files. However, this step makes no sense. Bundling usually
takes place in dedicated pure chroot. Therefore, the result of updating
POT files would be discarded anyway. So this is unnecessary work.
At the same time, the extractrc tool is used during the POT files update.
But this tool is part of the tdesdk-scripts-trinity package. Therefore,
when building other packages, it is usually not present. So updating POT
files during building could not work well.
That's why I already removed these unnecessary updates of POT files while
building DEB packages.
2. Do we still need to use the old modified version of xgettext?
I found out what the current status is and whether there are still reasons
to use the old modified version of xgettext (kde-xgettext). Patches for
the old version solve two things:
a) adding a way to enter plural forms of strings
b) adding a way to enter translation context
The current versions of gexttext already have both of these options, but
they seem to be implemented in a different way. Before we can start using
standard xgettext in TDE, we will need to add support for a new way of
plural forms of strings and translation contexts.
So far, we need to continue using an old modified version of kde-xgettext.
3. Can modern gettext replace the extractrc tool?
Modern versions of gettext can handle XML files. We use XML files
for 'kcfg', 'rc' and 'ui'. Using ITS support in gettext, there is a way
to define which texts are to be extracted for translations. I tested this
option, but I encountered some problems:
a) Tags are written in strings as html entities: < / > / &.
After extraction using xgettext, are left in this form. But the extractrc
tool convert them to the appropriate characters '<', '>', '&'. I did not
find a way to do this with xgettext and ITS.
b) XPath is used to determine which strings are to be extracted from XML
files. Files 'kcfg' use their own XML namespace and I did not find a way
how to enter XPath to work properly with ITS in xgettext.
That's why I decided it was better to continue using the extractrc tool.
4. How do we create and update POT files?
In order to provide strings for translation, we first need to create and
update POT files. The best place for these files is right in the source
code – in GIT. Therefore, these files need to be maintained independently
of the building binaries. Therefore, it is obvious that for this task it
is not a good time during the build binary packages, nor the usual use of
Automake or CMake.
Although the usual use of CMake with CMakeLists.txt for updating POT files
is not a good choice, using CMake as such seems to be a good idea. CMake
allows using the -P option to process a different file than the usual
CMakeLists.txt. In this case, it does not create build folder, it does
not create a cache - exactly as it suits us for our purpose.
I decided to use the name CMakeL10n.txt. I have prepared the CMake module
TDEL10n.cmake. This module provides functions for simplifing directories
handling – function tde_add_l10n_subdirectory as the equivalent for
add_subdirectory and function tde_auto_add_l10n_subdirectories as an
equivalent for tde_auto_add_subdirectories. And above all, the
tde_create_l10n_template macro that provides POT files generation.
This macro provides some benefits that seemed useful:
a) If resource files are processed – for example, *.ui, the work
file "rc.cpp" is commonly used to save extracted strings for translation.
This file is then processed by kde-xgettext. Links to the original
location of strings in the resulting POT file then refer to
this "rc.cpp", which is not very useful.
The tde_create_l10n_template macro performs additional processing by
replacing references to "rc.cpp" with references to the original resource
files. Therefore, the POT file does not refer to a non-existent "rc.cpp"
file, but to real locations in resource files.
b) When a new POT file is generated, a comparison is made with the
original POT file. If only the date of POT file generation is changed,
the original POT file will be left unchanged.
This prevents unnecessary POT file updates. This will allow to run a
regular update of POT files without causing unnecessary commits.
5. What's next?
For revisions and comments, I created a pull request containing a CMake
module TDEL10n.cmake:
https://mirror.git.trinitydesktop.org/gitea/TDE/tde-common-cmake/pulls/2
...and pull requests with a demonstration of use CMakeL10n in two modules:
https://mirror.git.trinitydesktop.org/gitea/TDE/abakus/pulls/1https://mirror.git.trinitydesktop.org/gitea/TDE/tdebase/pulls/19
After testing, we will need to add CMakeL10n.txt to generate POT files in
all other modules. Once we have automated updating of POT files,
translation work can begin!
6. How can users work on translations?
I will leave the answer to this question for later. Whoever was more
attentive could have noticed in several earlier commits that "something
is being prepared" :)
Cheers
--
Slávek
# inxi -Gxxb
System: Host: gb250 Kernel: 4.15.0-42-generic x86_64 bits: 64 compiler: gcc v: 7.3.0 Desktop: Trinity R14.1.0 tk: Qt 3.5.0
wm: Twin dm: startx Distro: Ubuntu 18.04.1 LTS (Bionic Beaver)
Machine: Type: Desktop System: Gigabyte product: B250M-D3H v: N/A serial: N/A
Mobo: Gigabyte model: B250M-D3H-CF v: x.x serial: N/A UEFI: American Megatrends v: F9 date: 04/10/2018
CPU: Dual Core: Intel Core i3-7100T type: MT MCP arch: Kaby Lake speed: 800 MHz min/max: 800/3400 MHz
Graphics: Device-1: Intel HD Graphics 630 vendor: Gigabyte driver: i915 v: kernel bus ID: 00:02.0 chip ID: 8086:5912
Display: server: X.Org 1.19.6 driver: modesetting unloaded: fbdev,vesa resolution: 2560x1440~60Hz
OpenGL: renderer: Mesa DRI Intel HD Graphics 630 (Kaby Lake GT2) v: 4.5 Mesa 18.0.5 compat-v: 3.0
direct render: Yes
Network: Device-1: Intel Ethernet I219-V vendor: Gigabyte driver: e1000e v: 3.2.6-k port: f040 bus ID: 00:1f.6
chip ID: 8086:15b8
Drives: Local Storage: total: 238.47 GiB used: 26.39 GiB (11.1%)
Info: Processes: 197 Uptime: 4h 11m Memory: 15.56 GiB used: 338.2 MiB (2.1%) Init: systemd v: 237 runlevel: 3 Compilers:
gcc: N/A Shell: bash v: 4.4.19 running in: konsole inxi: 3.0.30
TCC -> System Administration -> Monitor & Display has nothing enabled. Thus I would
expect no attempt from TDE to save power. Is this not the case? After 10 minutes, the
screen blanks for several seconds, after which the desktop wallpaper reappears, but
not the panel or open Windows. This happens whether the session is started from TDM
or with startx. I see nothing in /etc/X11 to account for this, though I'm not sure
what I would be looking for other than an Option "DPMS" statement in xorg.conf*. Is
this to be expected? Should I file a TDE bug?
--
Evolution as taught in public schools is religion, not science.
Team OS/2 ** Reg. Linux User #211409 ** a11y rocks!
Felix Miata *** http://fm.no-ip.com/
I do a lot of mix and match with displays and PCs. The one I have now booted to Sid
has 2560x1440 and 2560x1080 displays on an old ATI dual DisplayPort PCIe card. I have
the larger configured as primary and the smaller as upper via an xrandr script in
/etc/X11/Xsession.d/. 14.0.6dev's first greeter appearance after booting is on the
upper/smaller display, but moves to the lower/larger display on logging out. I'd
rather it always be on the larger. Is this something configurable? If so, where &
how? Is this something worth or needing a bug report?
--
Evolution as taught in public schools is religion, not science.
Team OS/2 ** Reg. Linux User #211409 ** a11y rocks!
Felix Miata *** http://fm.no-ip.com/