-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
extract will affect for comment _(xxx) #33
Comments
Lines 11 to 28 in 8bf1fd3
Extractor does not process C semantics. It uses simple regexps to search patterns. Even if we invent kludge for single line comments, multiline comment will fail. No plans to fix, but if someone suggest PR it will be accepted. |
Extractor is fragile for many more problems, like multi line strings, String concat with constants like LV_SYMBOL_WARNING "This is a warning with an icon". What do you think about changing the extraction process:
will be changed to
What do you think? |
IMO that's very complicated => difficult to use. I'd suggest to not invent anything new and borrow existing methods. For example, inspect how |
I looked at xgettext at https://git.savannah.gnu.org/gitweb/?p=gettext.git;a=blob;f=gettext-tools/src/x-c.c;h=917bd7c88deb9cc2d19b975962dd3a1cd2014c4e;hb=HEAD It is a very complicated c source containing a nearly full fledged (preprocessor) dealing specfically with all aspects of C. Additional parsers for other languages. For C only it is around 2400 LOC. I dont think, that we can transfer this to lv_i18n as it is way too complicated. As lv_i18n deals with "mainly embedded" we can assume, that programmer take care of their notation to be lv_i18n compatible and keep the simple regex as a solution. thanks for creating lvgl and lv_i18n! |
example follows:
in file xx.h
//#define CODE_CHECK_BTN_CONFIRM_TEXT _("#ffffff CHECKED#")
//#define CODE_CHECK_BTN_CANCEL_TEXT _("#ffffff CANCEL#")
#define PROTOCOL_HEADER _("protocol_header")
#define WEARABLE_HEADER _("wearable_header")
<<<<<
it will generate:
#ffffff CHECKED#
#ffffff CANCEL#
protocol_header
wearable_header
but first and second was not expected
The text was updated successfully, but these errors were encountered: