Edgewall Software

Opened 14 years ago

Closed 14 years ago

Last modified 12 years ago

#408 closed enhancement (worksforme)

support non translatable sections

Reported by: cboos Owned by: cmlenz
Priority: minor Milestone:
Component: Internationalization Version: 0.6
Keywords: i18n:ignore Cc: palgarvio, cmlenz

Description

In some (rare) cases, it would be useful to prevent text from being translated, in templates. A new directive could be used for that, for example i18n:ignore.

See use case in [T10253], but we could also use it for a few other situations (Trac:MissingTranslations#Unnecessarystrings).

For example:

<a href="..." i18n:ignore="">TracGuide</a>

would look nicer than:

<a href="...">${'TracGuide'}</a>

Change History (4)

comment:1 Changed 14 years ago by cmlenz

Doesn't xml:lang work for this anymore?

<a href="..." xml:lang="en">TracGuide</a>

comment:2 follow-up: Changed 14 years ago by cboos

I didn't know this was supported. But even so, will this prevent extraction?

That would be the main feature actually, not wasting the time of translators with stuff they shouldn't translate. And if it's not extracted and unique, it also won't be translated.

comment:3 in reply to: ↑ 2 Changed 14 years ago by cboos

Replying to cboos:

I didn't know this was supported. But even so, will this prevent extraction?

It seems so:

Note that elements defining xml:lang attributes that do not contain variable expressions are ignored by this filter. That can be used to exclude specific parts of a template from being extracted and translated.
from ApiDocs/genshi.filters.i18n

I'll test. Thanks for the feedback!

comment:4 Changed 14 years ago by cboos

  • Milestone 0.7 deleted
  • Resolution set to worksforme
  • Status changed from new to closed

Works great! Fixed in Trac in [T10265].

Thanks again.

Note: See TracTickets for help on using tickets.