On Mon, Feb 23, 2009 at 07:17:10PM +0100, poy(a)123gen.com wrote:
> If useful, I could also provide an option to indicate that
placeholders
> should be changed to inline if they have less than XXX characters.
> Currently, I don't think it is necessary. Placeholders should be used when
> the block is context free enough so that translation can be reused.
such an option would be just fine, i would always use it regardless of
the number of chars.
i understand the purpose of placeholders and how useful they must be for
other modules, it's just that without inlining i can't use them for html
links. good job though!
In that case, the option is useless. Defining tags as inline instead of
placeholder would have the same result.
maybe placeholders are just not the right way to go around this;
i've
thought of simple regexp replacements so that:
<a href=... target=...>link text</a>
in the master document is changed into:
<link>link text</link>
in the pot file.
the challenge then will be to replace <link>s back into corresponding <a
...> tags when generating translated pages.
I will need to identify the <link> by adding an ID (otherwise, I cannot
support "<link>txt1</link> <link>txt2</link>" to be
translated to
"<link>txt2</link> <link>txt1</link>"
I will probably also need a type attribute to help translator finding what
kind of tag it is.
But in that case, <a href=... target=...> is probably much clearer.
The goal of placeholders was not to hide something, but to help splitting
blocks, without loosing too much context.
To hide attributes of tags, but keeping the tag's content inline, another
option could be added.
It could change <tag attributes=...> to <tag id=#>.
This could be used to avoid typos to be introduced in attributes if they
are known to be untranslatable, and to reduce the amount of data that need
to be translated.
Best Regards,
--
Nekral