Add CMakeL10n rules. #8

Scalone
SlavekB scala 1 commity/ów z feat/CMakeL10n do master 5 lat temu
SlavekB skomentował(-a) 5 lat temu
Właściciel

The attached rules should work well enough. However, it would be useful to add support to tde_create_l10n_template macro for EXCLUDES to be an easy way to exclude some nested directories or files. For example, to avoid repeating string from the nested directory in the catalog from the parent directory. Or to exclude directories, such as tests performed during building.

The rules contain some useful things and some hacks:

  1. Instead of merging qt-messages.pot, which is not regularly updated, strings are extracted directly from ../dependencies/tqt3/src. As a result, the TQt3 strings will be up to date. And qt-messages.pot will no longer be needed.
  2. To extract the strings from the tqt3/src/xml/qxml.cpp file properly, #define is hidden before extracting. After extracting, the original file is restored.
  3. The tdeui/colors/rgb.txt file is modified to format as C source before extracting strings with color names. After extracting, the original file is restored.
  4. The tdeprint/cups/cupsdconf2/cupsd.conf.template file is modified to format as C source before extracting strings for CUPS configuration. After extracting, the original file is restored.

Thanks to editing files in place, POT files point to the correct lines in existing files.

The attached rules should work well enough. However, it would be useful to add support to `tde_create_l10n_template` macro for `EXCLUDES` to be an easy way to exclude some nested directories or files. For example, to avoid repeating string from the nested directory in the catalog from the parent directory. Or to exclude directories, such as tests performed during building. The rules contain some useful things and some hacks: 1. Instead of merging `qt-messages.pot`, which is not regularly updated, strings are extracted directly from [`../dependencies/tqt3/src`](../tqt3/src/branch/master/src/). As a result, the TQt3 strings will be up to date. And `qt-messages.pot` will no longer be needed. 2. To extract the strings from the [`tqt3/src/xml/qxml.cpp`](../tqt3/src/branch/master/src/xml/qxml.cpp#L56) file properly, `#define` is hidden before extracting. After extracting, the original file is restored. 3. The [`tdeui/colors/rgb.txt`](src/branch/master/tdeui/colors/rgb.txt) file is modified to format as C source before extracting strings with color names. After extracting, the original file is restored. 4. The [`tdeprint/cups/cupsdconf2/cupsd.conf.template`](src/branch/master/tdeprint/cups/cupsdconf2/cupsd.conf.template) file is modified to format as C source before extracting strings for CUPS configuration. After extracting, the original file is restored. Thanks to editing files in place, POT files point to the correct lines in existing files.
SlavekB skomentował(-a) 5 lat temu
Autor
Właściciel

Added commits already use EXCLUDES – see TDE/tde-common-cmake#4.

Added commits already use `EXCLUDES` – see TDE/tde-common-cmake#4.
MicheleC zrecenzowano 5 lat temu
MicheleC zostawił komentarz
Właściciel

mostly ok, some point to discuss together

mostly ok, some point to discuss together
CMakeL10n.txt Nieaktualny
##### verify tqt3 sources #######################
if( NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../dependencies/tqt3/src )
MicheleC skomentował(-a) 5 lat temu
Właściciel

Is it possible to look for tqt3 module path rather than using a relative path? This is because with relative path, the functionality would stop working if we move tqt3 so a different place.

This is a general observation, which is probably applicable in other parts/modules as well.

Is it possible to look for tqt3 module path rather than using a relative path? This is because with relative path, the functionality would stop working if we move tqt3 so a different place. This is a general observation, which is probably applicable in other parts/modules as well.
CMakeL10n.txt Nieaktualny
file( RENAME
${CMAKE_CURRENT_SOURCE_DIR}/../dependencies/tqt3/src/xml/qxml.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../dependencies/tqt3/src/xml/qxml.orig
)
MicheleC skomentował(-a) 5 lat temu
Właściciel

as for cmake #5, renaming of files could cause problems when the process is halted half way. Suggest we consider copy and work on the copied file instead of the original, if this does not cause problem with POT pointing to wrong files.

Or is there a way to get POT to point to original file even when working on a copy?

as for cmake #5, renaming of files could cause problems when the process is halted half way. Suggest we consider copy and work on the copied file instead of the original, if this does not cause problem with POT pointing to wrong files. Or is there a way to get POT to point to original file even when working on a copy?
CMakeL10n.txt Nieaktualny
##### restore tqt3/src/xml/qxml.cpp #############
if( EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../dependencies/tqt3/src/xml/qxml.orig )
MicheleC skomentował(-a) 5 lat temu
Właściciel

do we need to delete "${CMAKE_CURRENT_SOURCE_DIR}/../dependencies/tqt3/src/xml/qxml.cpp" before the rename is done?

do we need to delete "${CMAKE_CURRENT_SOURCE_DIR}/../dependencies/tqt3/src/xml/qxml.cpp" before the rename is done?
tde_l10n_create_template(
CATALOG "kmcop"
DESTINATION "../../../../tde-i18n/template/messages/tdelibs"
MicheleC skomentował(-a) 5 lat temu
Właściciel

as above, finding the location of tde-i18n would be preferred over using a relative location.

Same comment applies in various other files in this PR, I will not comment on those cases.

We should consider the idea of modifying "tde_l10n_create_template" so that we specify destination module and relative destination path. then the macro will search for the module (most of the time it would be tde-i18n but sometimes it could be an application module, like koffice-i18n).

as above, finding the location of tde-i18n would be preferred over using a relative location. Same comment applies in various other files in this PR, I will not comment on those cases. We should consider the idea of modifying "tde_l10n_create_template" so that we specify destination module and relative destination path. then the macro will search for the module (most of the time it would be tde-i18n but sometimes it could be an application module, like koffice-i18n).
Subproject commit 451ca41345a5fea5539f95829026cee9cb3ad118
MicheleC skomentował(-a) 5 lat temu
Właściciel

cmake submodule commit hash change should not be part of this PR, IMO.

cmake submodule commit hash change should not be part of this PR, IMO.
set( _conf_context "Do not translate the keyword between brackets (e.g. ServerName, ServerAdmin, etc.)" )
file( STRINGS ${CMAKE_CURRENT_SOURCE_DIR}/cupsd.conf.template _conf_template )
file( RENAME
MicheleC skomentował(-a) 5 lat temu
Właściciel

same comment as for "tqt3/src/xml/qxml.cpp" applies here on modifying existing file and then write back

same comment as for "tqt3/src/xml/qxml.cpp" applies here on modifying existing file and then write back
##### restore original cupsd.conf.template ######
file( RENAME
MicheleC skomentował(-a) 5 lat temu
Właściciel

as above, do we need to delete original file before renaming from .orig ?

as above, do we need to delete original file before renaming from .orig ?
##### change rgb.txt to format as C source ######
file( READ "${CMAKE_CURRENT_SOURCE_DIR}/rgb.txt" _colorsRC )
file( RENAME "${CMAKE_CURRENT_SOURCE_DIR}/rgb.txt" "${CMAKE_CURRENT_SOURCE_DIR}/rgb.orig" )
MicheleC skomentował(-a) 5 lat temu
Właściciel

same comment as for “tqt3/src/xml/qxml.cpp” applies here on modifying existing file and then write back

same comment as for “tqt3/src/xml/qxml.cpp” applies here on modifying existing file and then write back
##### restore original rgb.txt ##################
file( RENAME "${CMAKE_CURRENT_SOURCE_DIR}/rgb.orig" "${CMAKE_CURRENT_SOURCE_DIR}/rgb.txt" )
MicheleC skomentował(-a) 5 lat temu
Właściciel

as above, do we need to delete original file before renaming from .orig ?

as above, do we need to delete original file before renaming from .orig ?
SlavekB skomentował(-a) 5 lat temu
Autor
Właściciel

Commits squashed to one and updated to the current TDEL10n module options.

Commits squashed to one and updated to the current TDEL10n module options.
MicheleC zatwierdza te zmiany 5 lat temu
MicheleC zostawił komentarz
Właściciel

looks ok now

looks ok now
SlavekB zamknął(-ęła) ten pull request 5 lat temu
SlavekB usuwa gałąź feat/CMakeL10n 5 lat temu
SlavekB dodaje to do kamienia milowego R14.0.6 release 5 lat temu
Pull Request został scalony jako e532d9345d.
Zaloguj się, aby dołączyć do tej rozmowy.
Brak recenzentów
Brak kamienia milowego
Brak przypisanych
Uczestnicy 2
Powiadomienia
Termin realizacji

Brak ustawionego terminu realizacji.

Zależności

No dependencies set.

Reference: TDE/tdelibs#8
Ładowanie…
Nie ma jeszcze treści.