Translatable strings in .h file -- best way to resolve?
Jeff Kletsky
gnucash at allycomm.com
Thu Mar 18 10:56:55 EDT 2010
Derek Atkins wrote:
> Jeff Kletsky <gnucash at allycomm.com> writes:
>
> [snip]
>
>> #define OPTION_SECTION_ACCOUNTS N_("Accounts")
>> #define OPTION_NAME_TRADING_ACCOUNTS N_("Trading Accounts")
>>
>> #define OPTION_SECTION_BUDGETING N_("Budgeting")
>> #define OPTION_NAME_DEFAULT_BUDGET N_("Default Budget")
>>
>
> We should absolutely use N_() in the header files here (with your
> included SWIG fix). And then use _() in the .c and (_ ) in the scheme
> files as necessary.
>
> Doing:
>
> (N_ OPTOIN-SECTION-ACCOUNTS) in the scheme is just... wrong.
>
> -derek
>
>
So then when I submit a patch for things like
src/business/business-utils/business-utils.scm -- the existing usages of
(N_ "some string") probably should be converted to (_ "some string") --
correct? I was puzzled by that as, at least as I understand it, in C
N_(string) is a noop marker and _() is the gettext () call.
(define gnc:*business-label* (N_ "Business"))
(define gnc:*company-name* (N_ "Company Name"))
(define gnc:*company-addy* (N_ "Company Address"))
(define gnc:*company-id* (N_ "Company ID"))
(define gnc:*company-phone* (N_ "Company Phone Number"))
(define gnc:*company-fax* (N_ "Company Fax Number"))
(define gnc:*company-url* (N_ "Company Website URL"))
(define gnc:*company-email* (N_ "Company Email Address"))
(define gnc:*company-contact* (N_ "Company Contact Person"))
(export gnc:*business-label* gnc:*company-name* gnc:*company-addy*
gnc:*company-id*
gnc:*company-phone* gnc:*company-fax* gnc:*company-url*
gnc:*company-email* gnc:*company-contact*)
(define gnc:*option-section-accounts* (_ OPTION-SECTION-ACCOUNTS))
(define gnc:*option-name-trading-accounts* (_ OPTION-NAME-TRADING-ACCOUNTS))
(export gnc:*option-section-accounts* gnc:*option-name-trading-accounts*)
(define gnc:*option-section-budgeting* (_ OPTION-SECTION-BUDGETING))
(define gnc:*option-name-default-budget* (_ OPTION-NAME-DEFAULT-BUDGET))
(export gnc:*option-section-budgeting* gnc:*option-name-default-budget*)
More information about the gnucash-devel
mailing list