Community Central
Register
Community Central
Forums: Index Watercooler New Babel Template?
Fandom's forums are a place for the community to help other members.
To contact staff directly or to report bugs, please use Special:Contact.
Archive
Note: This topic has been unedited for 5432 days. It is considered archived - the discussion is over. Information in this thread may be out of date. Do not add to unless it really needs a response.

I looked through the Babel templates awhile ago and noticed that there were few standards keeping them together. Some used Wikitext tables, and some used HTML tables, some also didn't place users into categorys like they should, and none sorted themselves seperately from the list of users.

So I'm trying out a new Babel template. The template uses parserfunctions and makes use of a single template using the first parameter for the language and the second parameter for the level. If a language code it dosen't understand is used it defaults to english, and the level when unknown defaults to native. The template is a little longer and less legable when reading the code of course because wikitext dosen't give as much whitespace freedom as normal programming languages do. But the coloring works with the current CSS classes on Wikia (Though I'm considering placing everything into a style section itsself so that the template can be cross-wiki linked from central without needing to mess with the CSS files.) I currently only have en-N0123 and fr-N added to the template for demonstration and to use the template here it would require the current slightly unorganized User language categorys to be set with proper standards on how they are setup. And we might need some users to help fill in all the missing babelboxes that currently don't have anything on them (e.g. I think while ther is a fr-N there is no fr-0123.) But I'm interested to see what people think of a cross-wikia babel which uses only a single template in a way that makes sure all the boxes work alike. The template is over at The Gaiapedia at w:c:gaia:Template:Babel, and I have a example showing it still looks like normal at w:c:gaia:Gaiapedia:Sandbox. Dantman (Talk) 08:58, 8 February 2007 (UTC)


Good idea! A cross-wikia babel sounds very interesting --Ciencia Al Poder ¿Algo que decir? 17:43, 9 February 2007 (UTC)

I've moved it from it's location on the gaiapedia to the central wikia. It's at Template:Babel right now. I'm going to add 2 special paramaters to it now which will allow people to stop it from adding them to a category (For people who don't have the categorys on their wikia) and one which will cancel out the normal sizing and allow the box to fill an entire area. Dantman (Talk) 06:59, 11 February 2007 (UTC)

I've run into something unfortunate. It seams that parameters don't work when using a shared template. This does mean that we cant use {{w:babel}} to include a babel template into all wikia. But what can be done, is to make a babel box work on any wikia with this system, someone simply places {{subst:w:babel}} into Template:Babel on their own wikia. Then after that, babel will work on their wikia in all languages which are in the template at that time. That means instead of copying dozens of templates into each wikia you want to use babel on, all you half to do is add {{subst:w:babel}} to one page in each one. Not only that, but if we ever upgrage the one on wikia with new languages, then all they half to do is replace the contents on their wikia with {{subst:w:babel}} and their babel box will be updated with all the new languages in the babel box. Still better than dozens of individual templates, don't you think? Dantman (Talk) 07:35, 11 February 2007 (UTC)

mmm i was going to copy the Template:Babel to the w:c:Dofus but them i saw some things:

  • Box and fonts looks bigger than the old ones (yeah with 175% size) not every one has a 1200 display to avoid bother people.
Demos removed correctly working now--Cizagna (Talk) 19:47, 25 April 2007 (UTC)
  • only has FR, DE & JA and its missing like a lot of templates (though for my personal use is english and spanish making it usless unless i personaly update it).
  • Hard for some one to update as info its a little bit scramble.

like this:

{{#switch:{{{2|}}}|0=This person '''[[:Category:User en-0|does not understand]]''' '''[[:Category:User en|English]]''' (or understands it with considerable difficulties).
|1=This user is able to contribute with a '''[[:Category:User en-1|basic]]''' level of '''[[:Category:User en|English]]'''.
|2=This user is able to contribute with an '''[[:Category:User en-2|intermediate]]''' level of '''[[:Category:User en|English]]'''.

--~~~~
|3=This user is able to contribute with an '''[[:Category:User en-3|advanced]]''' level of '''[[:Category:User en|English]]'''.
|This user is a native '''[[:Category:User en|English speaker]]'''.}}

Could be change in like this

This user{{#switch:{{{2|}}}
|0=        '''[[:Category:User en-0|does not understand]]'''
|1= has a  '''[[:Category:User en-1|basic]]'''        level of
|2= has an '''[[:Category:User en-2|intermediate]]''' level of
|3= has an '''[[:Category:User en-3|advanced]]'''     level of
|is a native}} '''[[:Category:User {{{1}}}|{{Iso639|{{{1}}}]]'''{{#switch:{{{2|}}}|0= (or understands it with considerable difficulties).|1|2|3| speaker.}}

thought the issue of my option is that every language has their own order of how should it display so also could become contradictory =/

  • Insufficient (for not saying none) instructions on how to use it (i had to read the code to see how to use it properly and what extra things it has).

Now seeing the huge list of languages that are contain in the Template:Iso639 that keeps been updated its huge and creating a single template to contain all that information makes me wonder server stress? and template capacity? --Cizagna (Talk) 18:24, 22 April 2007 (UTC)

The size can be fixed with a little tweaking of the styles. And as for the lack of text, I only added some cause people should add the others if they need them. There's to much for one user to just put them all in at once. ~Dantman(talk) tricks Apr 22, 2007 @ 19:26 (UTC)

Added some languages, i can't make the UR work correctly and it does not load in the html, also notice how the EN and EN-1 breaks? it has to do with the English word is after finishing the switch, check if you can find something to work around. Also corrected the styles to match MediaWiki:Common.css --Cizagna (Talk) 23:50, 22 April 2007 (UTC)

Done, don't use &nbsp;, if you put a then the whitespace between it and the text will also be outputted. For example Find{{#if:{{{1|}}}| this | <nowiki/> that |}} if 1 was set then Findthis would be outputted. If it was blank then Find that would be outputted. It appears to have even better results than expected because the de is has also started to display correctly (Even though it was only en that I edited 0_o? Perhaps I should... oh wait... nevermind... User Babel already has the few languages it needs, and it's styles are standardized with the classes from the other userboxes. Trying to alter the way it looks would ruin the entire goal of making a simpler standard system of building userboxes using my box type classes instead. ~Dantman(talk) tricks Apr 24, 2007 @ 04:48 (UTC)
<nowiki/> creates a space? I wouldn't expect that. Also, I made some Swedish translations. – Smiddle 19:24, 24 April 2007 (UTC)
No, nowiki dosen't create a space, it prevents the parser from trimming the whitespace. Consider it a nonexistant character which is treated like a character. The parser trims whitespace off the ends of parserfunctions. So Do{{#if:{{{1|}}}| this | that }} Will always output Dothis or Dothat because the spaces on the outside of the text are trimmed out by the parser. But if you use Do{{#if:{{{1|}}}| <nowiki/> this | <nowiki/> that }} then the output will always be Do this or Do that because the nowiki which gives no actual output is treated like it's a character and because of that the outside spaces are still stripped, but the space in between the <nowiki/> and the text is not stripped. If you want a technical reason for this, when the parser passes through it takes all nowiki tags, saves the contents inside of them to an array, and then replaces that area of text with something like UNIQ-23f8u9834u54 (Note that a character which cannot be used legaly in XML is added in there to so that it's not possible to enter text which whould be replaced with something extra by that) because that text is there the trim function does not remove the space in between it and the normal text because it's only programmed to trim the whitespace off the left and right of the string. Then when the parser passes back through it replaces all those id's with the text it saved which was in between the nowiki tags. Because there was no text inside the nowiki tags that arbatrary string is replaced with nothing therfore not adding to the output but stopping some of the stuff from being trimmed. That's what that trick takes advantage of.
That trick also works with other things like whitespace:
{{#if:{{{a|}}}|<nowiki/>
{{!}}-
{{!}} class="a" {{!}} A
{{!}} {{{a}}
| }}{{#if:{{{b|}}}|<nowiki/>
{{!}}-
{{!}} class="b" {{!}} B
{{!}} {{{b}}
| }}
It's very handy in templates with optional rows. The fact that that nowiki is used allows the newline to only appear when the row actually shows up, which prevents extra p's from showing up when it isn't used. ~Dantman(talk) tricks Apr 24, 2007 @ 19:41 (UTC)
Now I get it. (Just testing so that I got it right: blah test – Smiddle 19:59, 27 April 2007 (UTC)
=o interesting this nowiki trick... im curious in the japanese one i wonder if its correct the order of the characters, as 日本語 its in some before な and in some after.
ja-0
この利用者は 日本語わかりません。(または理解するのがかなり困難です。)
ja-1
この利用者は 簡単日本語を話します。
ja-2
この利用者は 日本語ある程度話します。
ja-3
この利用者は 流暢日本語を話します。
ja-N
この利用者は 日本語母語としています。

--Cizagna (Talk) 19:47, 25 April 2007 (UTC)