Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Jump to content

Template talk:Lang: Difference between revisions

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
Content deleted Content added
Gadget850 (talk | contribs)
Line 153: Line 153:
Please replace the current code with [https://en.wikipedia.org/w/index.php?title=Template:Lang/sandbox&oldid=664388721 this revision] in the sandbox per the above discussion. An example of what this fixes has been added to the [[Template:Lang/testcases|test cases]] page. — [[User:Quoth-22|Quoth]] ([[User talk:Quoth-22|talk]]) 08:49, 28 May 2015 (UTC)
Please replace the current code with [https://en.wikipedia.org/w/index.php?title=Template:Lang/sandbox&oldid=664388721 this revision] in the sandbox per the above discussion. An example of what this fixes has been added to the [[Template:Lang/testcases|test cases]] page. — [[User:Quoth-22|Quoth]] ([[User talk:Quoth-22|talk]]) 08:49, 28 May 2015 (UTC)
: [[File:Yes check.svg|20px|link=]] '''Done'''<!-- Template:EP --> — '''''[[User:Mr. Stradivarius|<span style="color: #194D00; font-family: Palatino, Times, serif">Mr.&nbsp;Stradivarius</span>]]''''' <sup>[[User talk:Mr. Stradivarius|♪&nbsp;talk&nbsp;♪]]</sup> 10:27, 28 May 2015 (UTC)
: [[File:Yes check.svg|20px|link=]] '''Done'''<!-- Template:EP --> — '''''[[User:Mr. Stradivarius|<span style="color: #194D00; font-family: Palatino, Times, serif">Mr.&nbsp;Stradivarius</span>]]''''' <sup>[[User talk:Mr. Stradivarius|♪&nbsp;talk&nbsp;♪]]</sup> 10:27, 28 May 2015 (UTC)

===Cleanup===
* Templates which include <code>&amp;lrm;</code> example {{tlx|lang-ar}}; {{search link|text=insource:/\&lrm;/|link=insource:/\&amp;lrm;/|ns=ns10}}
* Articles which include <code>&amp;lrm;</code> in language templates; example Arabic language; {{search link|text=insource:/\&lrm;/|link=insource:/\&amp;lrm;/}}
--<span style="color:#800000">'''&nbsp;[[User:Gadget850|Gadget850]]'''<sup>[[User talk:Gadget850|&nbsp;''talk'']]</sup></span> 15:43, 28 May 2015 (UTC)

Revision as of 15:43, 28 May 2015

Rtl-lang in citation titles

In order to prevent a chunk of Arabic (etc.) in a citation title from interfering with the direction of following text, you need to use {{rtl-lang}} with the |nocat=true parameter, thus: {{rtl-lang|nocat=true|ar|.شبكة}}. As an example:

With rtl-lang
"IANA Delegation Report for [[:Template:Rtl-lang]]". 2013. Retrieved 3 February 2014. {{cite web}}: Invalid |ref=harv (help); URL–wikilink conflict (help)
Without rtl-lang
"IANA Delegation Report for .شبكة". 2013. Retrieved 3 February 2014. {{cite web}}: Invalid |ref=harv (help)

I've clarified this in the documentation. — Scott talk 11:42, 18 March 2014 (UTC)[reply]

Please don't use this template in citation templates. The included markup renders in the title field of the COinS metadata:

Markup Renders as
{{cite book |title=IANA Delegation Report for {{rtl-lang|nocat=true|ar|.شبكة}}}}

IANA Delegation Report for Template:Rtl-lang.

'"`UNIQ--templatestyles-00000010-QINU`"'<cite class="citation book cs1">''IANA Delegation Report for [[:Template:Rtl-lang]]''.</cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&rft.genre=book&rft.btitle=IANA+Delegation+Report+for+%3ATemplate%3ARtl-lang&rfr_id=info%3Asid%2Fen.wikipedia.org%3ATemplate+talk%3ALang" class="Z3988"></span>

We are adding a new parameter to the templates:

Markup Renders as
{{cite book/new |title=IANA Delegation Report for |script-title=ar:.شبكة}}

IANA Delegation Report for .شبكة.

script-title: Title in the original writing system where it is not appropriate to italicize (e.g. Arabic, Chinese, Hebrew, Japanese). Displays after title in upright font and is isolated from the surrounding text-direction settings so that right-to-left scripts render properly. The language may be set by prefixing the value with the ISO 639-1 two-character language code followed by a colon. Unrecognized codes are ignored and will display in the rendered citation. Example: |script-title=ar:العربية.

This should be going live soon. --  Gadget850 talk 12:44, 3 October 2014 (UTC)[reply]

Because |script-title= is concatenated with the value held in |title= into meta-parameter Title, |title= is not required. Editor Scott's example cite might be written like this:
{{cite web/new|url=http://www.iana.org/reports/c.2.9.2.d/20131021-xn--ngbc5azd|accessdate=3 February 2014|script-title=IANA Delegation Report for شبكة |year=2013}}
which gives:
IANA Delegation Report for شبكة. 2013. Retrieved 3 February 2014. {{cite web}}: Invalid |script-title=: missing prefix (help)
Probably not the best way to use |script-title=. I left out the language identifier part of |script-title= because of the mix of English and Arabic.
What |script-title= does is isolate strongly directional text from not so strongly direction text. The English and the Arabic are strongly directional so they can coexist pretty comfortably; the digits are not. So, if the title was "IANA Delegation Report for شبكة 2013", then |script-title= is no help:
IANA Delegation Report for شبكة 2013. 2013. Retrieved 3 February 2014. {{cite web}}: Invalid |script-title=: missing prefix (help)
This is a new parameter. There will be a learning curve and surely there will be opportunity to improve its functionality.
Trappist the monk (talk) 13:55, 3 October 2014 (UTC)[reply]

size parameter

Hello – For the sake of scripts such as Arabic that can be tricky to read at default font-size, I've added a size parameter to the sandbox version here (current as of this message) and some tests to Template:Lang/testcases#Sandbox. Would there be any objection if a request was made to replace the main version with this one? Sardanaphalus (talk) 12:09, 17 August 2014 (UTC)[reply]

Protected edit request on 17 September 2014

Per the above, please replace the current code with this version in the sandbox. Sardanaphalus (talk) 00:07, 17 September 2014 (UTC)[reply]

Not done: please establish a consensus for this alteration before using the {{edit protected}} template. --Redrose64 (talk) 06:53, 17 September 2014 (UTC)[reply]
Does no response not count as a "don't mind" consensus? Or is, in fact, the requirement to try to find objection – a WP:BEANS variation – ? Sardanaphalus (talk) 09:05, 17 September 2014 (UTC)[reply]
There are many more changes than just adding provision for |style=, which make it far more difficult to compare old with new. Why is it necessary to change the capitalisation of the templates? Why introduce a newline before the {{category handler}}, hidden inside comment markers? Why remove all the newlines within the {{category handler}}? Why was the comment at the bottom, concerning categories, removed? I don't see the necessity for any of these, especially not the newline removal. --Redrose64 (talk) 09:34, 17 September 2014 (UTC)[reply]
Taking your queries in order:
  • It isn't necessary to capitalise or lowercase template names, but I've noticed that the names of templates whose influence and/or effect tends to be relatively small or local – e.g. inline templates – tend to be lowercased, while the names of those whose influence and/or effect may be larger or not so local – e.g. boxes/bars or, as regards influence/reach, templates such as {{Category header}} – tend to be capitalised (sentence-cased);
  • Newlines between comment markers are one of the ways to present sections/segments/units of code as such...
  • ...as can removing newlines within these sections/segments/units so that their own sections/segments/units remain, in turn, the next most readily identifiable;
  • Aren't people likely – or, in this case, able – to edit this template also already likely to be aware of how categories, interwikis and templates with /doc pages are organised..? (And, if not, soon would be..?)
Regards, Sardanaphalus (talk) 20:11, 17 September 2014 (UTC)[reply]
The whitespace was clearer before you changed it. If you just want the size parameter added, I have no objections. — Martin (MSGJ · talk) 12:43, 18 September 2014 (UTC)[reply]
  • Yes, please – it's the parameter that'll be used. I am intrigued, though, that you find it easier to see and handle structure within
<span>{{
| = [[ {{
  || = 
  | = {{
    |{{}}
    |
    }}
  }} ]]
| = 
}}
than within
<span><!--
-->{{
    | = [[ {{ ||= |={{ |{{}} | }} }} ]]
    | = 
   }}
or, giving the #switch its own structure level, within
<span><!--
-->{{
    | = [[ {{
            || = 
            | = {{ |{{}} | }}
           }} <!--
     -->]]
    | = 
   }}
Regards, Sardanaphalus (talk) 20:00, 18 September 2014 (UTC)[reply]
I've made the change. The main advantage of the first version is that every open brace is accompanied by an indent, so it is easier to ensure that you don't forget to close any braces. I guess it's just personal preference though, and what you've grown used to. I think your other suggestions are more esoteric. If you're writing a template, I don't think anyone would complain about the structure you choose; but I don't think you should be wary of changing templates wholesale over to your preferred structure. — Martin (MSGJ · talk) 08:17, 19 September 2014 (UTC)[reply]

Lang-xx-YY TfDs

 – Pointer to relevant discussions elsewhere

Several {{Lang-xx-YY}} templates have been nomintead for deletion. Participants here may be interested in those TfDs, pro or con.

See also: The nominator raised related issues in a number of other forums (most of these deal with {{lang-xx-YY}} templates in particular, while the one at WT:NOT is more general):

 — SMcCandlish ¢ ≽ʌⱷ҅ʌ≼  07:16, 19 August 2014 (UTC)[reply]

Technical issue at another language template

Please see Template talk:Engvar#Use standard language codes; could use some extra brains on that. {{Engvar}} didn't even have a talk page until just now, so virtually no one is watching it.  — SMcCandlish ¢ ≽ʌⱷ҅ʌ≼  06:52, 7 November 2014 (UTC)[reply]

Epigraphic style of Latin

In Latin spelling and pronunciation and a few other articles, an epigraphic style (meaning based on the style of lettering used in inscriptions) of Latin text is used. That is, Latin words and graphemes are presented in small caps, with v and i used instead of i, j and u, v, and acute accent and the i longa (U+A7FE) used for long vowels in place of macrons. Epigraphic Latin needs two CSS properties: font-variant: small-caps; and font-family: 'fonts with i longa in them';. In addition, it should have the selector lang="lat".

Applying class=Unicode to epigraphic text is not a solution, because the fonts for that class in MediaWiki:Common.js are Arial Unicode MS and Lucida Sans Unicode, which do not contain the character i longa. See LATIN EPIGRAPHIC LETTER I LONGA (U+A7FE) Font Support on FileFormat.Info and {{Latin-epigr}} for a list of some fonts that do. To allow the character to display properly, we need a separate list of fonts for Latin epigraphic text.

Small caps are currently achieved using the {{smallcaps}}, but this simply adds inline CSS.

The most elegant solution would be to apply the language code and a class to the text — perhaps class="epigraphic" or class="epigr" — and add the properties to text selected by both the language code and the class using an external CSS file, like MediaWiki:Common.js. (A class is required because not all Latin text is in epigraphic style.) The second most elegant solution is to create a template using inline CSS, as I have already done with {{Latin-epigr}}. But using selectors and an external style sheet would reduce the amount of code.

Is this proposal possible, or should I settle with a template using inline CSS? — Eru·tuon 21:11, 13 December 2014 (UTC)[reply]

Inclusion of left-to-right mark for right-to-left languages

As discussed here previously, the left-to-right mark (&lrm;) can help browsers determine when to switch back to left-to-right rendering. I've noticed that it's being manually included at the end of RTL templates such as {{lang-ar}} and {{lang-ur}}. This seems to be an easy candidate for automatic inclusion in this template when the rtl argument is specified. Does anyone have any concerns over such an inclusion? — Quoth (talk) 16:38, 20 May 2015 (UTC)[reply]

|rtl= does not seem to be documented. -- Gadget850 talk 22:07, 20 May 2015 (UTC)[reply]
Or we could just bypass this and wrap the content in <bdi>...</bdi>. This isolates text directionality from the outer text so it doesn't matter. — Preceding unsigned comment added by Gadget850 (talkcontribs) 23:38, 20 May 2015‎ (UTC)[reply]
Which means simply replace the <span>...</span> tags with <bdi>...</bdi> tags in {{lang}}. The attributes added to the <span> tag in {{lang}} are supported by <bdi>. The attribute dir= could probably go away. Module:Citation/CS1 wraps titles provided with |script-title= inside <bdi>...</bdi> tags but doesn't set the dir= attribute.
{{lang-ar}} includes &lrm; in its output. That character is probably not needed with <bdi>...</bdi>.
Trappist the monk (talk) 00:00, 21 May 2015 (UTC)[reply]
Now in sandbox. -- Gadget850 talk 01:00, 21 May 2015 (UTC)[reply]
I would go with <bdi>...</bdi>, this will permit elimination of &lrm; which often cause problems with copypaste. The <bdi>...</bdi> element is inherently dir=auto so if the enclosed text is entirely of a single direction, no explicit dir= attribute should be needed either. --Redrose64 (talk) 07:07, 21 May 2015 (UTC)[reply]
<bdi>...</bdi> sounds like the ideal solution. Unfortunately I'm not so sure we should use it at the moment for compatibility reasons. It seems to have been introduced as part of HTML5, and might not be supported by a wide enough variety of browser versions.[1] We should thoroughly test this across browsers and platforms before implementing it.
Though even if that tag doesn't work, we might have better luck with <bdo>...</bdo>,[2] which was introduced in HTML4, and seems to currently have much broader support. I've yet to do any testing of either myself, and am going purely on what's currently written on the MDN, which is by no means up-to-date. — Quoth (talk) 09:41, 21 May 2015 (UTC)[reply]
A quick test shows that IE11 does not support <bdi>...</bdi> but does support <bdo>...</bdo>. -- Gadget850 talk 11:18, 21 May 2015 (UTC)[reply]
When we were deciding on <bdi>...</bdi> for cs1|2 I remember looking at the compatibility issue. If I remember correctly, the incompatibilities for current browsers were in the less often used attributes. I don't remember where I discovered that and don't have the time now to rediscover it. If I wrote about it, that writing will be in the Help Talk: Citation Style 1 archives.
Trappist the monk (talk) 11:53, 21 May 2015 (UTC)[reply]
After some testing in Chrome and IE11 on Windows 8, <bdo>...</bdo> no longer seems applicable for this situation. Its intended use seems to be only to override unicode's bidi algorithm for a stretch of text (forcing LTR to RTL or vice versa), but without the text isolating property that <bdi>...</bdi> has. This means that numbers and other weak characters which follow still become entangled in the preceding text direction. And like Gadget850, I was unable to get <bdi>...</bdi> to have any effect in IE11 (with or without CSS shims and element attributes). Unfortunately the only method I found to work correctly in IE11 was using &lrm;.
Since that seems to currently be the de facto method anyway, and unless anyone has any other alternatives, I'd like to move ahead with consolidating its use from the individual RTL templates into this one as originally suggested. The benefit at least being that when browser support is finally broad enough to change to a better method, we won't have to update as many places. — Quoth (talk) 15:05, 24 May 2015 (UTC)[reply]

Protected edit request on 28 May 2015

Please replace the current code with this revision in the sandbox per the above discussion. An example of what this fixes has been added to the test cases page. — Quoth (talk) 08:49, 28 May 2015 (UTC)[reply]

DoneMr. Stradivarius ♪ talk ♪ 10:27, 28 May 2015 (UTC)[reply]

Cleanup

-- Gadget850 talk 15:43, 28 May 2015 (UTC)[reply]