6
0
Fork 0

Add macro to prepare XML files for xgettext #9

Zusammengeführt
SlavekB hat 1 Commits von feat/add-prepare-xml nach master vor 5 Jahren zusammengeführt
SlavekB hat vor 5 Jahren kommentiert
Besitzer

During the preparation of CMakeL10n rules in kiosktool I found out that here is the extractxml script, which is used to extract strings from xml file kiosk_data.xml. That's why I was looking for a solution how to ensure this within CMakeL10n rules.

Using the extractxml script would have the result that location information in the POT file would refer to a non-existent temporary file – as it was in the case of extractrc. Furthermore, I could prepare CMake processing specifically for this one file. Or, I could prepare a generic XML extraction macro that will be useful for other cases as well.

That's why I chose the generic macro. During the preparation of the macro, I found that the functionality of extractxml and extractrc scripts is largely the same. For this reason, I added several options in the new macro tde_l10n_prepare_xml to make this macro meet the needs for both uses.

By the way, just by testing this macro I noticed the wrong semicolon processing that is fixed in #8.

During the preparation of CMakeL10n rules in kiosktool I found out that here is the [`extractxml`](../kiosktool/src/branch/master/kiosktool/extractxml) script, which is used to extract strings from xml file [`kiosk_data.xml`](../kiosktool/src/branch/master/kiosktool/kiosk_data.xml). That's why I was looking for a solution how to ensure this within CMakeL10n rules. Using the `extractxml` script would have the result that location information in the POT file would refer to a non-existent temporary file – as it was in the case of `extractrc`. Furthermore, I could prepare CMake processing specifically for this one file. Or, I could prepare a generic XML extraction macro that will be useful for other cases as well. That's why I chose the generic macro. During the preparation of the macro, I found that the functionality of `extractxml` and `extractrc` scripts is largely the same. For this reason, I added several options in the new macro `tde_l10n_prepare_xml` to make this macro meet the needs for both uses. By the way, just by testing this macro I noticed the wrong semicolon processing that is fixed in #8.
MicheleC hat die Änderungen vor 5 Jahren genehmigt
MicheleC hat einen Kommentar hinterlassen
Besitzer

I didn't really check the regex in fine details, but the rest of the PR seems ok.

I didn't really check the regex in fine details, but the rest of the PR seems ok.
SlavekB hat vor 5 Jahren kommentiert
Ersteller
Besitzer

During macro preparation I tested tde_l10n_prepare_xml on POT files generated in tdebase. This helped in revealing and resolving shortcomings. The 160 POT files generated in tdebase give good material to test that the result is the same 😃

During macro preparation I tested tde_l10n_prepare_xml on POT files generated in tdebase. This helped in revealing and resolving shortcomings. The 160 POT files generated in tdebase give good material to test that the result is the same :smiley:
SlavekB hat vor 5 Jahren kommentiert
Ersteller
Besitzer

By the way, here is another difference compared to extractrc. In extractrc is not expected to have multiple tags on one line. For example:

<label>First</label><label>Second</label>

With extractrc only i18n("First") will be generated and the rest will be ignored. With extractxml in kiosktool only i18n("Second") will be generated and the rest will be ignored. The tde_l10n_prepare_xml macro expect this situation and will generate i18n("First");i18n("Second");

By the way, here is another difference compared to extractrc. In extractrc is not expected to have multiple tags on one line. For example: ``` <label>First</label><label>Second</label> ``` With extractrc only `i18n("First")` will be generated and the rest will be ignored. With extractxml in kiosktool only `i18n("Second")` will be generated and the rest will be ignored. The tde_l10n_prepare_xml macro expect this situation and will generate `i18n("First");i18n("Second");`
SlavekB hat vor 5 Jahren kommentiert
Ersteller
Besitzer

When testing with tdelibs, it turned out that the extractrc script allows to override context using the tag attribute. Therefore, this ability was added to the tde_l10n_prepare_xml macro.

When testing with tdelibs, it turned out that the extractrc script allows to override context using the tag attribute. Therefore, this ability was added to the tde_l10n_prepare_xml macro.
MicheleC hat die Änderungen vor 5 Jahren genehmigt
MicheleC hat einen Kommentar hinterlassen
Besitzer

looks good

looks good
SlavekB hat diesen Pull-Request vor 5 Jahren geschlossen
SlavekB löschte die Branch feat/add-prepare-xml vor 5 Jahren
SlavekB hat diesen Issue vor 5 Jahren zum R14.0.6 release Meilenstein hinzugefügt
Der Pull Request wurde als 8f3b50336f gemergt.
Anmelden, um an der Diskussion teilzunehmen.
Keine Reviewer
Kein Meilenstein
Niemand zuständig
2 Beteiligte
Nachrichten
Fällig am

Kein Fälligkeitsdatum gesetzt.

Abhängigkeiten

Keine Abhängigkeiten gesetzt.

Referenz: TDE/tde-cmake#9
Laden…
Hier gibt es bis jetzt noch keinen Inhalt.