Template talk:Xyzy: difference between revisions

From Wiktionary, the free dictionary
Latest comment: 11 years ago by Liliana-60 in topic Proposal: Remove script template call
Jump to navigation Jump to search
Content deleted Content added
Liliana-60 (talk | contribs)
Line 83: Line 83:
:::: I've fixed what I can, all transclusions except for one are now in discussion pages or user subpages. {{User:CodeCat/signature}} 19:41, 3 December 2012 (UTC)
:::: I've fixed what I can, all transclusions except for one are now in discussion pages or user subpages. {{User:CodeCat/signature}} 19:41, 3 December 2012 (UTC)
::::: I tried to make the change but Ruakh reverted me. :/ {{User:CodeCat/signature}} 16:22, 4 December 2012 (UTC)
::::: I tried to make the change but Ruakh reverted me. :/ {{User:CodeCat/signature}} 16:22, 4 December 2012 (UTC)
::::::I guess he hates you too now since he found out we were friends in 2006. -- [[User:Liliana-60|Liliana]] [[User talk:Liliana-60|•]] 19:04, 4 December 2012 (UTC)
: If it is possible to convert all script templates to consist solely of (e.g.) <code><nowiki><{{#switch:{{{face|}}}|ital=i|head|bold=b|span}} class="Hebr {{#ifeq:{{{face|}}}|term|mention-Hebr}}" lang="{{{lang}}}">{{{1}}}</{{#switch:{{{face|}}}|ital=i|head|bold=b|span}}></nowiki></code>, with all of their script-specific behavior being handled in the site CSS, then — yes, we should do approximately that (though this is not the right place to propose it), and then afterward we should modify {{temp|Xyzy}} accordingly. If that is ''not'' possible, then we can't do this, either. (I say "we should do ''approximately'' that" because I think a few tweaks are warranted. Firstly — it should be <tt><nowiki>{{{lang|}}}</nowiki></tt> rather than <tt><nowiki>{{{lang}}}</nowiki></tt>: no need to generate garbage HTML when the language-code is missing. Or maybe even <tt><nowiki>{{#ifeq:{{{lang}}}|{{urlencode:{{{lang}}}}}|{{{lang|}}}}}</nowiki></tt>, so we don't produce e.g. <tt>lang="proto:gem-pro"</tt>. Secondly — if we're defining our script templates in such a way that it's literally impossible for them to distinguish <tt>face=head</tt> from <tt>face=bold</tt>, then we might as well eliminate one or the other. Similarly perhaps with <tt>face=ital</tt> and <tt>face=term</tt>, though with those two there's at least the possibility of distinguishing <tt>i</tt> from e.g. <tt>i.mention-Hebr</tt>. Thirdly — we ''may'' want to include some bidi-helping stuff, like adding <tt>&amp;lrm;</tt> before and after.) —[[User: Ruakh |Ruakh]]<sub ><small ><i >[[User talk: Ruakh |TALK]]</i ></small ></sub > 18:56, 3 December 2012 (UTC)
: If it is possible to convert all script templates to consist solely of (e.g.) <code><nowiki><{{#switch:{{{face|}}}|ital=i|head|bold=b|span}} class="Hebr {{#ifeq:{{{face|}}}|term|mention-Hebr}}" lang="{{{lang}}}">{{{1}}}</{{#switch:{{{face|}}}|ital=i|head|bold=b|span}}></nowiki></code>, with all of their script-specific behavior being handled in the site CSS, then — yes, we should do approximately that (though this is not the right place to propose it), and then afterward we should modify {{temp|Xyzy}} accordingly. If that is ''not'' possible, then we can't do this, either. (I say "we should do ''approximately'' that" because I think a few tweaks are warranted. Firstly — it should be <tt><nowiki>{{{lang|}}}</nowiki></tt> rather than <tt><nowiki>{{{lang}}}</nowiki></tt>: no need to generate garbage HTML when the language-code is missing. Or maybe even <tt><nowiki>{{#ifeq:{{{lang}}}|{{urlencode:{{{lang}}}}}|{{{lang|}}}}}</nowiki></tt>, so we don't produce e.g. <tt>lang="proto:gem-pro"</tt>. Secondly — if we're defining our script templates in such a way that it's literally impossible for them to distinguish <tt>face=head</tt> from <tt>face=bold</tt>, then we might as well eliminate one or the other. Similarly perhaps with <tt>face=ital</tt> and <tt>face=term</tt>, though with those two there's at least the possibility of distinguishing <tt>i</tt> from e.g. <tt>i.mention-Hebr</tt>. Thirdly — we ''may'' want to include some bidi-helping stuff, like adding <tt>&amp;lrm;</tt> before and after.) —[[User: Ruakh |Ruakh]]<sub ><small ><i >[[User talk: Ruakh |TALK]]</i ></small ></sub > 18:56, 3 December 2012 (UTC)
:: We would never get proto:gem-pro though, because the code we use is just gem-pro. The proto: is only added when calling {{temp|proto:gem-pro}}, not any other times. {{User:CodeCat/signature}} 19:41, 3 December 2012 (UTC)
:: We would never get proto:gem-pro though, because the code we use is just gem-pro. The proto: is only added when calling {{temp|proto:gem-pro}}, not any other times. {{User:CodeCat/signature}} 19:41, 3 December 2012 (UTC)

Revision as of 19:04, 4 December 2012

Adding more languages

How about adding Old Armenian (code {{xcl}}) to this list? Admittedly, the language is not terribly important, but the default font (Sylfaen) and size (too small) of Armenian letters in all versions of Windows is extremely badly chosen, unlike Cyrillic or Georgian, so it is important to have sc=Armn always forced. --Vahagn Petrosyan 06:11, 24 July 2009 (UTC)Reply

As noted above, we should consider a few additions but very carefully; the tradeoff is between template code that is parsed millions of time (if one was to re-render the whole database) vs the number of useful cases. Adding another code for a script already in the switch is less expensive that a new script. The other issue is that removing a case would be painful, as there is no automatic way to find the uses. Robert Ullmann 09:49, 24 July 2009 (UTC)Reply
It is CRITICAL that this list be revised very carefully; just throwing in a bunch of "reasonable" additions will cause overhead that makes the template a de-optimization. And it is very difficult to remove things. Add to the list below and we will look at the stats and add some presently. Robert Ullmann

So for now, suggested additions:

code script language comments
xcl Armn Template:xcl default font (Sylfaen) and size (too small) of Armenian letters in all versions of Windows is extremely badly chosen, done
ur ur-Arab Template:ur probably a good idea, especially as Nastaʿlīq script is distinctive, done
cu Cyrs Template:cu would be a default (all others are known, not defaulted), display w/o it is okay, done
got Goth Template:got Opera and IE apparently display boxes even with font installed w/o this, done
bn Beng Template:bn under consideration, ~180 entries, ~350 trans, bn.wikt
mr Deva Template:mr under consideration, ~90 entries, ~450 trans, mr.wikt
gu Gujr Template:gu under consideration, ~60 entries, ~300 trans, gu.wikt
ka Geor Template:ka under consideration, ~800 entries, ~1400 trans, ka.wikt

Others: cu Template:cu would be a good idea, but has two scripts (Glagolitic and Cyrillic) with probably no useful default. We might decide to default it to Cyrillic and require sc=Glag on the others; this sort of thing (defaulting) has not been considered carefully yet.

Note, cu Template:cu should default to {{Cyrs}}, not {{Cyrl}}. And Glagolitic is used much, much rarer so it would indeed be a good idea to explicitly require sc=Glag everytime needed. --Vahagn Petrosyan 14:05, 5 August 2009 (UTC)Reply

Added above: note that by treating Cyrs as the default (rather than always correct) script for cu, this is modifying the semantics of the template a bit. Probably an okay idea. Robert Ullmann 07:40, 20 August 2009 (UTC)Reply

As Hindi and Urdu are essentially two dialects of one language and while working on one, I frequently edit and make use of the other, I am going to re-add ur=ur-Arab to the template. A month of indecision is quite enough for at least this one edit. — [ R·I·C ] opiaterein — 23:48, 18 September 2009 (UTC) I could take this opportunity to be myself, but I'd rather just leave it to an investigator to see what the hell this strike was for. — [ R·I·C ] opiaterein23:50, 18 September 2009 (UTC)Reply

Deletion debate

Template:rfd-failed

Proposed new version.

See Wiktionary:Grease pit#Script support. A proposed new version would not have a magic list of hard-coded languages, but would instead use {{en/script}} and so on. Also, it would offer a sc= parameter, so that other templates can do something like {{ Xyzy | ... | sc={{{sc|}}} | lang={{{lang|}}} }} rather than something like {{ {{#if: {{{sc|}}} | {{{sc}}} | Xyzy }} | ... | lang={{{lang|}}} }}. —RuakhTALK 20:38, 24 July 2011 (UTC)Reply

It seems that it would turn the template into a generic way to use script templates much in the way that {{language}} is used for language codes. —CodeCat 21:30, 24 July 2011 (UTC)Reply
Doesn't {{langscript}} already do this? Could we just redirect Xyzy to that? --Mglovesfun (talk) 21:44, 24 July 2011 (UTC)Reply
{{langscript}} does only a very small part of what is needed: it doesn't support face= (which is necessary) or sc= (which is desirable IMHO, for the reason I gave above), and only partially supports lang= (whereas full support would be desirable); and it breaks horribly when lang= is not specified (which currently occurs in {{Xyzy}} in all instances of {{term}} where neither sc= nor lang= is specified, and who-knows-where else). If we make my proposed change to {{Xyzy}}, then I think we'll be able to redirect {{langscript}} to {{Xyzy}} without harm; but if we were to redirect {{Xyzy}} to {{langscript}} right now, without greatly enhancing the latter, then we would cause noticeable breakage in a lot of pages. —RuakhTALK 23:39, 24 July 2011 (UTC)Reply
Actually, correction: {{langscript}} does something a bit different. It is equivalent to the new {{Xyzy/script}}. —RuakhTALK 15:59, 25 July 2011 (UTC)Reply
Something is wrong in Ἀράξης. --Vahag 20:31, 25 July 2011 (UTC)Reply
That entry referred to the script-template {{Zyyy}} ("Code for undetermined script"), which didn't exist. I've created that template, but also changed the page not to use it, since we're giving the word in Latin script. Thanks for pointing it out. —RuakhTALK 22:13, 25 July 2011 (UTC)Reply

Proposal: Remove script template call

I propose that the Xyzy template's code be replaced with the following:

<{{#switch:{{{face|}}}|ital=i|head|bold=b|span}} class="{{#if: {{{sc|}}} | {{{sc}}} {{#ifeq:{{{face|}}}|term|mention-{{{sc}}}}} | {{ Template:{{{lang}}}/script }} {{#ifeq:{{{face|}}}|term| mention-{{ Template:{{{lang}}}/script }} }} }}" lang="{{{lang}}}">{{{1}}}</{{#switch:{{{face|}}}|ital=i|head|bold=b|span}}><noinclude>{{documentation}}</noinclude>

This would remove calls to templates like {{Latn}} entirely. Additionally, the Xyzy subtemplate calls, langprefix calls, and does-template-exist calls are all removed.

You can test the code by copying the code to the Xyzy edit box and using the "Preview page with this template" tool. --Yair rand (talk) 18:34, 3 December 2012 (UTC)Reply

Not all scripts use bold headwords, though. —CodeCat 18:38, 3 December 2012 (UTC)Reply
Those that don't should have font-weight specified in Common.css, not in a exclusive template. --Yair rand (talk) 18:40, 3 December 2012 (UTC)Reply
I still don't see much point in this, really. I would prefer it if {{Xyzy}} were eliminated altogether, in favour of my earlier proposal of doing everything through CSS classes and/or language tags. Then we wouldn't even need to call Template:{{{lang}}}/script at all, which would be faster still. —CodeCat 18:51, 3 December 2012 (UTC)Reply
Why do you want to remove does-template-exist? All pages listed in Special:Whatlinkshere/Template:Eror would break horribly. -- Liliana 18:40, 3 December 2012 (UTC)Reply
Then we should fix those, first. —CodeCat 18:51, 3 December 2012 (UTC)Reply
Once you've done that, you can just wipe it from Template:Xyzy/script. I bet that by itself would help with performance. -- Liliana 18:52, 3 December 2012 (UTC)Reply
I've fixed what I can, all transclusions except for one are now in discussion pages or user subpages. —CodeCat 19:41, 3 December 2012 (UTC)Reply
I tried to make the change but Ruakh reverted me. :/ —CodeCat 16:22, 4 December 2012 (UTC)Reply
I guess he hates you too now since he found out we were friends in 2006. -- Liliana 19:04, 4 December 2012 (UTC)Reply
If it is possible to convert all script templates to consist solely of (e.g.) <{{#switch:{{{face|}}}|ital=i|head|bold=b|span}} class="Hebr {{#ifeq:{{{face|}}}|term|mention-Hebr}}" lang="{{{lang}}}">{{{1}}}</{{#switch:{{{face|}}}|ital=i|head|bold=b|span}}>, with all of their script-specific behavior being handled in the site CSS, then — yes, we should do approximately that (though this is not the right place to propose it), and then afterward we should modify {{Xyzy}} accordingly. If that is not possible, then we can't do this, either. (I say "we should do approximately that" because I think a few tweaks are warranted. Firstly — it should be {{{lang|}}} rather than {{{lang}}}: no need to generate garbage HTML when the language-code is missing. Or maybe even {{#ifeq:{{{lang}}}|{{urlencode:{{{lang}}}}}|{{{lang|}}}}}, so we don't produce e.g. lang="proto:gem-pro". Secondly — if we're defining our script templates in such a way that it's literally impossible for them to distinguish face=head from face=bold, then we might as well eliminate one or the other. Similarly perhaps with face=ital and face=term, though with those two there's at least the possibility of distinguishing i from e.g. i.mention-Hebr. Thirdly — we may want to include some bidi-helping stuff, like adding &lrm; before and after.) —RuakhTALK 18:56, 3 December 2012 (UTC)Reply
We would never get proto:gem-pro though, because the code we use is just gem-pro. The proto: is only added when calling {{proto:gem-pro}}, not any other times. —CodeCat 19:41, 3 December 2012 (UTC)Reply
Oh, darn it, good point. Ah, well. —RuakhTALK 20:15, 3 December 2012 (UTC)Reply
We don't even have &lrm; now. Does it really add anything helpful? --Yair rand (talk) 15:09, 4 December 2012 (UTC)Reply
I think it would be desirable for {{Hebr}}, but I've never quite had the courage to try to identify and deal with all existing entries that would be affected by it. Currently I add it directly to entries in many cases where I can see that I need it. (Its purpose is: {{Hebr|פוּ|lang=he}}, {{Hebr|בָּר|lang=he}} currently puts the to the right of the bár, because there are no left-to-right characters between the two stretches of Hebrew, whereas {{Hebr|פוּ|lang=he}}&lrm;, &lrm;{{Hebr|בָּר|lang=he}} puts them in correct English order.) —RuakhTALK 16:25, 4 December 2012 (UTC)Reply