lang: Add support for raw catalog references with _R
_R marks a raw catalog entry as Referenced (= used) for cases where the catalog pointers are handled at a lower level.
This commit is contained in:
parent
05093fbf49
commit
7a80252556
2 changed files with 3 additions and 2 deletions
|
@ -46,6 +46,7 @@
|
|||
|
||||
#define _N(s) (__extension__({static const char __c[] PROGMEM_N1 = s; &__c[0];}))
|
||||
#define _n(s) _N(s) // declare and return untranslated string
|
||||
#define _R(s) (s) // return reference to translatable string (for warning suppression)
|
||||
|
||||
/** @brief lang_table_header_t structure - (size= 16byte) */
|
||||
typedef struct
|
||||
|
|
|
@ -149,8 +149,8 @@ def extract_refs(path, catalog):
|
|||
|
||||
# match message catalog references to add backrefs
|
||||
RE_CAT = r'''
|
||||
(?<!(?:/[/*]|^\s*\#) [^\n]*) # not on a comment or preprocessor
|
||||
\b (?:_[TO]) \s* \( \s* (\w+) \s* \) # $1 catalog name
|
||||
(?<!(?:/[/*]|^\s*\#) [^\n]*) # not on a comment or preprocessor
|
||||
\b (?:_[TOR]) \s* \( \s* (\w+) \s* \) # $1 catalog name
|
||||
'''
|
||||
|
||||
for m in regex.finditer(RE_CAT, source, regex.M|regex.X):
|
||||
|
|
Loading…
Reference in a new issue