Page MenuHomePhabricator

GRAMMAR should allow selective bolding, etc.
Open, MediumPublicFeature

Description

Some GRAMMAR routines add isolated words such as grammatical articles,
prepositions and postpositions around (possibly inflected) words, which
usually are wiki names.

When these words are to be bolded, italicized, or anything the like,
translators currently have the choice to either drop this formatting,
or appy it to the entire group of words yielded by a GRAMMAR routine.

Neither of these is often desirable.

What was generally needed is something wraped around the word passed to
GRAMMAR after inflection, but before any extra words or particles are added
before or after it. What exactly should undergo formatting or the like,
and what should not, would be language dependant and thus has to be dealt
with inside the GRAMMAR converter routines.

I propose extending its syntax from {{GRAMMAR:case|word}} to

{{GRAMMAR:case|word|before|after}}

with two optional paramters which shall be put in front of and behind the
word "word", respectively.

Thus, e.g. for uselang=ksh

{{ucfirst:{{GRAMMAR: Dativ, en |{{SITENAME}}|<i>|</i>}}}}

would show as either of:

En de <i>Wikipedia</i>
Em <i>WikiTravel</i>

depending on the grammatical gender of {{SITENAME}}.

I believe, this is fairly easily coded, and for the most if not all
GRAMMAR routines, I do volunteer implementing it. I've made this bug
report mainly in order to collect feedback and possible additons or
enhancements that I am not aware of. Thanks!


Version: 1.18.x
Severity: enhancement

Details

Reference
bz27223
TitleReferenceAuthorSource BranchDest Branch
k8s: refresh wmcs-k8s-get-cert.sh scriptrepos/cloud/toolforge/lima-kilo!23aborreroarturo-k8s-refresh-wmcs-k8s-gemain
Update metrics-server and overhaul its deploymentrepos/cloud/toolforge/wmcs-k8s-metrics!2taaviupdate-metrics-servermain
Customize query in GitLab

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:17 PM
bzimport set Reference to bz27223.
bzimport added a subscriber: Unknown Object (MLST).

Maybe {{ucfirst:{{GRAMMAR: Dativ, en |{{SITENAME}}|''$1''}}}} is better, because you can use $1 in more places.

There is a use case where HTML link syntax should be pulled inside GRAMMAR, see
https://translatewiki.net/wiki/Thread:Support/About_MediaWiki:Creditssource-source-work/ksh
concerning message MediaWiki:Creditssource-source-work/ksh

A possible solution would be along the lines of

... {{GRAMMAR:em|$6|<a href="$7">|</a>}} ...

here. This poses another problem, since explicit HTML anchors are usually
not tolerated as part of message texts in MediaWiki, if I am not mistaken.

Aklapper changed the subtype of this task from "Task" to "Feature Request".Feb 4 2022, 12:24 PM