PLURAL and GENDER optimization

PLURAL and GENDER optimization

Edited by author.
Last edit: 23:20, 16 August 2022

Verdy p claims that this kind of edits (other example with Plural) is useful. What about the reality?

Discussions (1, 2) have not been productive.

Pols12 (talk)20:40, 15 August 2022

Functionally, they are identical, of course.

The question is what is more useful for translators and reviewers, both in terms of content and in terms of the review process.

In terms of content, you should decide how to write things, and document this decision with an explanation. I'll give you an example from Hebrew, the main language into which I translate. The Localisation guidelines explicitly recommend writing whole words inside the GENDER clause and not just the suffixes. (As I was writing this reply, I was surprised to discover that it was documented only for GENDER, even though the same practice has been used for PLURAL. I've just added it for PLURAL.) The explanation for Hebrew is that using whole written words is better for finding them using the search engine.

My French is not perfect, but as far as I can see, you don't have an explicit recommendation for that in Localisation guidelines/fr. I recommend writing it explicitly. I am not telling you what the recommendation should be—you, the translators into French, should discuss it and decide it. You may use the same logic as in Hebrew—that it's easier to find words using search engines. Or you can decide that the opposite is more comfortable for you, for example because you want to reduce repeated words. It's up to you, but you should document it and try to be consistent. (Also, it is not documented, but in Hebrew, repeating GENDER and PLURAL many times just for the sake of not repeating strings adds too much syntax and mixing of different writing systems, and it makes translation unnecessary complex, but it may be less bad for French. Again, up to you.)

In terms of updating and reviewing process, the people who complain that too many updates just for the sake of consistency are not great have a point. Consistency is good, but this should be at least discussed because a lot of edits make review difficult. And if the practices are documented, enforcing consistency is more acceptable to everyone.

Now the tricky part is to agree about what to document ;)

Amir E. Aharoni (talk)06:50, 16 August 2022
 

... Oh, and the empty GENDER clauses, like "{{GENDER:|}}Vous" here, look weird to me, and I'm not sure what's the reason to do it. I understand that it is done to avoid warnings about missing GENDER, but I'd put the single pronoun into the GENDER clause, simply because it is similar to the source message, and it makes the wikitext look nicer. "{{GENDER:|}}Vous" is functionally the same, but looks wrong. But if anyone has a good explanation for using an empty GENDER clause, I have the same recommendation as above: discuss it, make a decision, and document it in Localisation guidelines/fr.

Amir E. Aharoni (talk)06:56, 16 August 2022

This has to do with the way expansion works: an empty GENDER (with the same parameter) is eliminated directly and cached thoughout messages, it does not fill any cache slot and potentially saves memory or avoids bugs in the wiki server duiring expansion (I can see some visible performance benefits on page rendering, it is small I admit it, but there's no real need to pass it static parameters that will be returned unconditionnally as is).

Anyway it just remains glued with the term on which it was supposed to apply, so I don't see why it looks wrong when it fact it's just removing any parts that will be unconditionally returned. Being empty, it just means that it has been considered but not really needed (except on TWN itself due to its local validation rules).

In fact, when exporting, such GENDER: or PLURAL: rules with a single possible output could also be automatically dropped (keeping only its unconditional return value, often empty, and the target wiki would be even more satistified. Such cleanup could as well be done by the script importing into the target wiki (to avoid unnecessary work at expansion time). If an empty GENDER: or PLURAL: looks weird for you then a non-empty one returning a non-empty constant text is equally weird because in both cases it is not necessary at all.

Verdy p (talk)08:19, 16 August 2022

Is this performance impact documented anywhere?

Amir E. Aharoni (talk)13:26, 16 August 2022

I am confident that there is no such performance impact that would be relevant here. The syntax convention should be based on other criteria, some of which are already mentioned above.

Nike (talk)14:15, 16 August 2022