As discussed in MR #11 ([1]), `qtr()` is only meant to be used with static
strings, not constants or variables. Translation occurs through pointing
xgettext at the `qtr` keyword to find strings (as an alternative to `_()`,
taking into account the common need to convert to a Qt `String` type).
Thus use with anything other than a static string relies upon xgettext
having to recognise and ignore instances that do not actually wrap static
strings, which is considered to be wrong, even if it happens to work.
Accordingly here `qfut()` has been introduced. This is to be used in cases
where `qtr()` was incorrectly used around constant identifiers and
variables (i.e. where a combination of `qfu()` plus translation is needed,
with the string being defined elsewhere (with `N_()`)). The `qtr()` macro
itself now acts as a wrapper to `qfut()` for cases where the parameter is
in fact a static string, thus additionally marking it to be picked up by
xgettext, unlike other use of `qfut()`.
Notes for future readers, the set of macro names reflect:
- `qfu()`: Creates a Qt `String` type from UTF-8 ('f'=from, 'u'=utf8).
- `qfue()`: `qfu()` with ampersand escaping ('e'=escape).
- `qfut()`: `qfu()` with translation ('t'=translation).
- `qtu()`: Qt `String` to UTF-8 ('t'='to', 'u'=utf8).
- `qtr()`: this is a wrapper for `qfut()`, acting as an xgettext marker,
similar to `_()` except returning a Qt `String`. ('tr'=translate).
[1]: https://code.videolan.org/videolan/vlc/-/merge_requests/11
>From Qt 5.14.0, Qt::SplitBehavior enum is available and QString::split function causes warning when QString::SplitBehavior enum is used.
Signed-off-by: Pierre Lamot <pierre@videolabs.io>
Those files could generated in implementation-specified location by
build systems, as it's the behaviour of qmake based build system.
In particular, meson implementation provides the same behaviour and
it will be handled automatically, thus having a full path makes the
file not found with meson.
Use local-path and specify all include directories to simulate this.
New files must not have the same filename as existing ones.