Template talk:Topic by country/layout

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Do not make major changes without discussion[edit]

@Verdy p: , your changes are creating issues with the display of the navbox, particularly for topics with navby parameter set to "continent". If there are specific issues, discuss them here before making big changes that are apparently aesthetic in nature. Josh (talk) 13:19, 6 April 2020 (UTC)[reply]

They are not "estehetic"; these are real fixes, and this new temlplate that you placed everywhere recently without notice broke 'a lot of categories.
It's a fact you never tested it correctly. Countries that were precisely categorized are now broken, notably France or USA. And the autocategorization is more generally undesirable, the sort keys are also incorrect for many places. Categorization is better done by explicit categories where they are relevant and not by magic (and frequently worng) guesses. verdy_p (talk) 13:23, 6 April 2020 (UTC)[reply]
Other fixes: do not use centering, allow correct placement of infoboxes. And make them look more like other horizontal navboxes (allow them to coexist)
Such giant template is unmaintainable and very slow. It uses really too many costly calls to parser functions without any control. verdy_p (talk) 13:26, 6 April 2020 (UTC)[reply]
You are making broad claims without specifics. You did not specify exactly what categorization is either being added that shouldn't or not being added that should. You did not specify what sort key is wrong in your opinion or what the correct sort key should be. You claim it is not correct placement, but how exactly did you determine the correct placement? Make it look like which other horizontal navboxes (there is no standard)? Josh (talk) 13:48, 6 April 2020 (UTC)[reply]
Politics is no longer in Society, and so on. And there are many missing items (because you forget aliases), because you decided to do everything in a template which is very huge, and unnecessarily cluttered (you made maultiple errors with HTML comments incorrectly closed).
You deleted many correct categortization by editing tons of categories which are now incorrectly tied to their parent.
Such way of doing massive edits has broken years of patient construction. This is definitely not the way to do that.
And you use a presentation which is for alert boxes, not for navboxes. Plus the CSS or tagging was simply incorrect (invalid in HTML5).
Really this code is disgusting, and really unmaintainable. You make too many assumptions about the categorization system (which you changed unilaterally and massively everywhere in the world, ignoring the various exceptions that were patiently collected).
You invented also a very uncommon categorization (e.g. listing government as "culture", but not at all in politics!).
Your thousands edits in many categories has made them unusable.
So It's me that can say that you did not discuss such massive automated changes in lot of categories, without any form of discussion and without any human inspection of the dramatic effect. verdy_p (talk) 19:09, 6 April 2020 (UTC)[reply]
Category:Politics is still a sub of Category:Society, so what are you talking about? Category:Government is indeed a sub of Category:Politics, and easily fixed without being disruptive. Do you have a policy you can reference that declares which 'presentation' is for what use? I have no problem with improving the code for better compatibility and efficiency, but your edits are a lot more than HTML tweaks, so those should be evaluated and implemented separately from your opinions on categories, etc. You also appear confused between issues with a template itself, and issues with where the template is used (that issue should be discussed on the target page's talk). Also, you should add an additional level of indentation on your comments after a previous one so we can see your comment clearly marked. Josh (talk) 19:30, 6 April 2020 (UTC)[reply]
This is not my "opinion", because you disregarded everything that was in the thousands categories you massively edited automatically without looking at them.
It's a fact that your categorization system does not work at all, and this template does not find all the relevant data that was before your massive edit.
It's also a fact that even this template only has broken syntax with the HTML comment tags that are unnecessary, incorrectly closed/mismatched, and clutter everything (that's what I decluttered to fix them, using simple editing that made things clearer).
But your massive edits in categories to insert this template has broken too many of them (and not because of my edit, but because of your broken autocategorization). You never discussed it and did not perform any basic test to check the autocategorization, and you should have not applied it blindly in tons of categaories without loioking at the result.
This is definitely not the way to do.
In addition this is the very old way of writing templates: its expansion is massive, the code is hard to maintain. And it's impossible to fix correctly the many pages where you inserted this template becauyse you massively deleted their content. verdy_p (talk) 19:40, 6 April 2020 (UTC)[reply]
Nobody is debating that Category:Politics is still a sub of Category:Society, and that is exactly how this template categorizes things so where is your problem with it? You act as if there's a massive miscategorization here, but even your example is one of correct categorization. Josh (talk) 19:56, 6 April 2020 (UTC)[reply]
You claim there are comment tags that are mismatched... what line? You simply removed nearly all comment tags blindly without bothering to understand their presence. If they all had syntax errors, we would see dozens of '-->' or such on the target pages, but they are not there, so apparently they do not constitute a syntax error. If merely the odd one or two have an error, then a simple fix to those tags alone would suffice. Josh (talk) 19:56, 6 April 2020 (UTC)[reply]
As for edits to improve HTML compatibility, that sounds great and I'm all for that kind of thing. Is there one of your edits that was specifically a HTML5 compatibility improvement and not rolled in with the rest of your changes? If you are right and there are such improvements, and can be done as a specific edit just to address compatibility, then I have no problem with that. Josh (talk) 20:01, 6 April 2020 (UTC)[reply]
You can just look for "-- >" with the extra space in the middle which is invalid. Such HTMl somments clutering the code when they are not even needed cause severe maintenance costs. Where you don't need them, don't use them at all. ! verdy_p (talk) 20:18, 6 April 2020 (UTC)[reply]
When you remove them, you can see that other edits were for not testing superfluous categories when the needed parameter is simply empty or unspecified (this adds to the server cost in costly parser calls).
I preserved all the logic even if I think that this new template was really undesired and should have not been applied in many categories that are now broken or left uncategorized or categorized at the wrong place. In Commons, categories are maintained topic by topic (automation just breaks in too many places where categories are not relevant; testing many of them just does not work: too many tests, slow, and finally lot of missing cases you did not figure out). What you did was to break the patient work over years by tons of contributors.
To make more relevant tests, using wiki templates is the wrong way to go.
Additionally this new template has completely voided the translation of this site, favoring only English. And I don't know where you learnt geography because you made many incorrect assumptions (e.g. Yemen was listed by you in Europe!). Such template is simply not needed, it has dramatically increased the maintenance cost for no benefit at all. It is much worse than what was before (and that was discussed by many).
You did not even took any step to document it and list the caveats (because you don't know them).
Really lok at the code without the clutter, it is much more readable. verdy_p (talk) 20:18, 6 April 2020 (UTC)[reply]
Thanks for getting to some specifics. The '-- >' only occurred within commented-out code...they were intentionally 'broken' to remain commented-out. Nonetheless I went ahead and deleted them as there is no harm in doing so and apparently they were confusing.
I actually have no problem with cutting the comments out for the most part. I do not believe the 'load' of them is anywhere as great as you claim, but again, I do not really care if they go away or stay, except for those that contain actual comment text of course. Unfortunately other not-okay edits were wrapped into the 'comment clean-up'. On the other hand this edit you did clearing out the extra blank comments I have no problem with. So far as I can tell at a glance, you did not in that case adversely affect the output, so that's all well and good.
I also agree with you on the question of testing whether a parameter is even set before running it into an 'ifexist' to save a few parser steps. The savings are not that great to make a capital case over, but again this one is not a problem, so I added 'if' tests (I'm sure you noticed that most of the possible cat tests already only ran if the parameter was set) to cut out the redundant 'ifexist' tests within the template. Josh (talk) 21:29, 6 April 2020 (UTC)[reply]
Another MAJOR problem in fact is the autocategoization that you made, which does not work.
You perform many guesses on actual names or containment of categories in the autocategorization that are simply wrong and were never tested. A common prolblem is the used of "in" or "of". Whcih actuall varies depending on levels. And large coutries are not sorted like smaller ones: your application was made assuming countries with more details than others. And it does not work for "countries" that are actually subentities or disputed (not UN members) or with historic countries: you've dropped masssively many details and broke the historic relatiunships that were patiently built.
The other problem is translation: it has been completely cancelled: this template is simply NOT translatable at all. You'ver done that only for Enplish.
The final problem is maintenance: it's impossible to maintain it and change the categorization when needed, category by category. You've cancelled years of discussions, where some populated categroies where splitted or other were merged, creating specific subcategroization for them. Testing all these cases by some magic guess causes a severe cost on the server. Wiki templates are not suitable for that. Their expansion is too costly.
Other solutions were developed using modules (at much lower cast) and you removed all of them. They allowed full translatability, including via wikidata labels.
And really this coding style is very "old school", this is what was done years ago. It may be acceptable for templates that are used rarely, but certainly not in a template that you wanted to apply massively and blindly in all the most important categories of Commons, and without any discussion. So with these massive edits, Commons turned back to history for about a dozen of years. What you did was huge damage, and destruction of work made since years by many that were patiently buiolding the categories and tuning them.
And really this was not needed at all. The impact is too big, just based on unverified assumptions, and maintening that is now a nightmare. verdy_p (talk) 09:46, 7 April 2020 (UTC)[reply]

I protected the template fully. Please discuss here and make an agreement, and then I will implement the agreement. 4nn1l2 (talk) 12:18, 7 April 2020 (UTC)[reply]

Due to the rather large number of different changes that verdy_p and I wish to make, it is perhaps best that each of these be discussed and agreed upon or not in detail, so I've gone through the diff between the last version prior to their edit, and their latest edit as a starting point. I have attempted to list each of the notable changes they made, though due to the level of changes, I may have missed a couple, so I welcome them adding any I miss to this list. I have also included other changes that were made during the regrettable edit war so that they can be considered as well. What follows is a laundry list of what verdy_p, I, or both of us have attempted to make so that each can be discussed below. Josh (talk) 20:00, 8 April 2020 (UTC)[reply]

Language options[edit]

  • Original code: {{LangSwitch|en={{{topic}}} by {{{index}}} in {{{countrycont1}}}:}}
  • Add French language entries to existing {{LangSwitch}} calls within the template. (verdy_p)
    • {{LangSwitch|en={{ucfirst:{{{topic}}}}} by {{{index}}} in {{{countrycont1|}}}:|fr={{ucfirst:{{{topic}}}}} par {{{index}}} en {{{countrycont1|}}} :}}
  • Use country templates (e.g. {{Asia}}) to provide continent names automatically in the user's language. (josh)
    • {{LangSwitch|en={{ucfirst:{{{topic}}}}} by {{{index}}} in {{{{{countrycont1|}}}}}:|fr={{ucfirst:{{{topic}}}}} par {{{index}}} en {{{{{countrycont1|}}}}} :}}

 Support Perfectly good thing to add as many language options as possible. I support both enhancements. Josh (talk) 20:00, 8 April 2020 (UTC)[reply]

Actually this is only partly translatable. The "topic" and index" are not translated (they would require using Wikidata labels) but there are other difficulties because the form is actually variable (includibng in English with the article "the", in French, Italian with the mark of plural, in German with the genitive...)
There's really no need to translate and display this, because categories already display (in the vertical nfobox) the correctly translated labels for categories from their topic in Wikidata. So this addition is superfluous.
Finally you dropped the classification of sublists by merging everything in it (whatever their status, plus some contextual notes per item). This really does not help proper categorization and navigation into relevant subtopics. Existing templates for navboxes were much smarter (and less costly as well) and ezasier to manage locally. verdy_p (talk) 20:16, 8 April 2020 (UTC)[reply]
@Verdy p: I was just adding a comment on that when you posted yours, so see below. The heading of the list is not intended as a translation of the category name, so that might be part of your confusion. I certainly agree that the Wikidata infobox should be the primary source at the moment for an internationalized label and description of the category itself. Josh (talk) 20:31, 8 April 2020 (UTC)[reply]
 Comment An additional note on translations: The main portion of the template display is the country list, and this already uses country templates to automatically display each country name in the user's language per labels provided by Wikidata. That functionality is beyond this template, but this template leverages it already to ensure the user sees a list of countries in their chosen language. The heading already uses {{LangSwitch}} to allow translations to be added. This is admittedly not the easiest as it requires each new language to make an update to the template, and right now the parameters index and topic are the raw strings used in template names and so are not translated at all. One feature I had yet to get to was to add the parameters indexlabel and topiclabel which would contain Wikidata-provided internationalized labels for each and these could be used in the header to allow better translations by LangSwitch. Alternatively, the heading as a whole could be passed in the user's language from the front end template to this one, removing the LangSwitch completely. In any case there are definitely some ways to further improve the internationalization of the template. Josh (talk) 20:31, 8 April 2020 (UTC)[reply]


Table parameters[edit]

Original table display

align="center" style="border-width:2px; border-style:solid; border-color:#48d; border-left-width: 8px; background:#fbfcff;"

Proposed table display (per verdy_p last edit)

style="clear:none;font-size:90%;line-height:normal;margin:2px auto;border:2px solid #48d;border-left-width:8px;background:#f8f9fa;padding:2px" cellspacing="1" cellpadding="0"

Alternative proposed table display (per verdy_p last edit but using normal text and centering list text)

style="clear:none;line-height:normal;margin:2px auto;border:2px solid #48d;border-left-width:8px;background:#f8f9fa;padding:2px" cellspacing="1" cellpadding="0"

 Support Alternative table display with regular text and centered list. It is important that the country links be displayed in standard text size. Small text, especially for links, should be limited to those things that are not generally intended for most users to use (such as hidden categories). Small text displays okay on a lot of our screens, but for many users small text is difficult to read and to click on links. For a navigation box such as this, it is the whole point that regular users be able to navigate using these links no differently than the links to contents of the category, and so the links should be the same size as those below. Note that a list containing every country would get very long, so it is tempting to reduce the size of the text, but the correct answer would be to use the built in support for limiting the list to the continent level, cutting down on the list size without making the links unusable by some users. As for the centering of the list, it appears cleaner centered but if others feel it would be better left or right justified, I am not firmly opposed to those as an alternative. Josh (talk) 20:00, 8 April 2020 (UTC)[reply]

Actually this is not really my proposal, I just adjusted it to follow your color scheme (for now), but I think it is wrong. This should not be used by navboxes and infoboxes, only by notices.
And there's no need to make this "giant". Just to hide the more important infobox that describes strictly the content appearing on the left and not the related contents. Navboxes for lateral topics are listing weakly related data (on some changed criteria).
Your change made masively did not help when the existing navboxes were much more discrete and did not abscure the content of the categories. Note that when these list navboxes are used in a parent category to list the subcontents (in subcategories sometimes not all listed on the same page), it appears "below" the diffusion notice box: there's a logical reading order.
As well the descriptions in plain text in category pages is frequently no longer needed if all is specified by the infobox from wikidata. It can be safely removed, except additional warning messages explaining the topic more precisely (and somtimes giving more hints such as licencing restrictions and directions of use for these categories, when they are not in a standard notice box). : : And beware of HTML tables ! They are not accessible (and displaying a big country flag everywhere is simply not needed at all; the flag aappears correctly where appropriate in relevant infoboxes). The links they are going to are also unconditional, causing problems as well. Wikidata infoboxes have much better role for displaying it correctly, still in an accessible way, and without obscuring the category contents (rest of the description and lists of members). verdy_p (talk) 20:46, 8 April 2020 (UTC)[reply]
verdy_p (talk) 20:46, 8 April 2020 (UTC)[reply]

{{Diffuseat}} code[edit]

  • Original code: {{#if:{{{diffuseat|}}}|{{diffuseat|{{{diffuseat}}}}}|{{diffuseat|50}}}}
  • Proposed code: {{Diffuseat|{{#if: {{{diffuseat|}}} | {{{diffuseat|}}} | 50 }}}}

 Neutral Not sure it makes a hill of beans worth of difference, but I have no problem with it either. Josh (talk) 20:00, 8 April 2020 (UTC)[reply]

{{Editprotect}} this line should be changed to {{Categorise}}.

"Use {{CatDiffuse}} temporarily, just for categories which require one-shot diffusion. For main categories requiring permanent control use {{Categorise}}".--RZuo (talk) 10:21, 20 July 2021 (UTC)[reply]

@NguoiDungKhongDinhDanh: THIS LINE {{#if:{{{diffuseat|}}}|{{diffuseat|{{{diffuseat}}}}}|{{diffuseat|50}}}}. --RZuo (talk) 18:51, 17 November 2021 (UTC)[reply]
This doesn't seem to meet SUNS, as the template has over 3400 transclusions and such edits (using this one instead of that one) can be considered "breaking change". NguoiDungKhongDinhDanh Name me 19:12, 17 November 2021 (UTC)[reply]
  1. which of "Specific, Uncontroversial, Necessary, Sensible" is not met?
  2. what would be broken by this change? nothing. RZuo (talk) 21:42, 17 November 2021 (UTC)[reply]
    See w:WP:TPE#MD; I'm not very sure about the "Sensible" part. I'm not declining, and wouldn't oppose if someone else is willing to do it. NguoiDungKhongDinhDanh Name me 02:35, 19 November 2021 (UTC)[reply]
    I second Nguoi..., the {{Edit request}} here should be temporary {{Tl}}ed due to function controversial. Liuxinyu970226 (talk) 01:03, 20 November 2021 (UTC)[reply]
i'll give one example Category:Politics of Austria.
"This category has become too crowded." no, it's not too crowded. it only has 54 files.
"Please remove or replace this tag afterwards." no, it's impossible to remove the {{CatDiffuse}} because it's transcluded in this template.
as it's explicitly defined, "Use {{CatDiffuse}} temporarily, just for categories which require one-shot diffusion. For main categories requiring permanent control use {{Categorise}}!"--RZuo (talk) 16:50, 22 November 2021 (UTC)[reply]

Use 'includeonly' only for category section[edit]

  • Move the includeonly tags to only cover the section that adds categories (per verdy_p)

 Support This is fine, though actually it should be able to be done away with completely by using proper if statements for categorization. Josh (talk) 20:00, 8 April 2020 (UTC)[reply]

Reduce comment usage[edit]

  • Use empty comments more sparingly (per verdy_p)

 Neutral No particular problem with this, although it should be transparent to the target page. Gain is negligible but again if verdy_p feels it is valuable, I have no opposition to it. Josh (talk) 20:00, 8 April 2020 (UTC)[reply]

Add more continent support[edit]

  • Original version supported up to three continents.
  • Proposal is to add support for countrycont4 and countrycont5 using identical code as countrycont3 (per Josh)

 Support This is for the rare cases where three is not enough. There is no impact on pages which do not require more than three continents listed. Josh (talk) 20:00, 8 April 2020 (UTC)[reply]

Sandbox proposal[edit]

@Verdy p and 4nn1l2: I have created a working version at Template:Topic by country/layout/sandbox. This includes most of edits from verdy_p plus my own added continent support. It is intended as a reflection of all of the agreed changes to the template, and I will try and update it as the discussion matures (adding or removing changes as they are agreed on or opposed). Unfortunately, due to recent events, I must state this is not a new place to edit war over. It is merely to demonstrate a working version of the template with only the agreed-upon changes included (i.e. no opposed or controversial additions). It can be then used by anyone to preview how such a version would work on a target page. If something is wrong with the sandbox version, please raise the issue here and I will in good faith update it. Thanks to all for helping move this forward constructively. Josh (talk) 20:00, 8 April 2020 (UTC)[reply]

The continents additions were not needed and in fact most of them have errors, and this has removed the transalatibility that were present in existing templates that your replaced (taking the labels from Wikidata, and sorting lists accurately per language, plus detecting aliases (including contextual article "the" which may or may not be present after some prefixes, or including the detection of other name variants, and detecting redirections). For the presentation, they used consistant presentation for navboxes (including vertical infoboxes or horizontal cat links at bottom of pages); the extra decrotation you added was comuing from Cmboxes intended for administrative alerts, but not for navigation).
Now there's the huge problem of parent categories that are incorrectly detected for autocategoization: this also does not work and is based on assumptions that are wrong in a lot of cases (including the complexity of leading "the" article, or changes between "in" or "of" depending on the level. Before, these categorization were done catagory by category, so they could be managed individually, without having to edit a global template (with huge cost i nthe server is the template is widely used). But you should know that the categorisation is subject to lot of adjustments as the topics are not completely covered and have complex relationships. In summary, this change was not needed at all. Existing navboxes offered easier maintenance and detection of what was really needed in each category. verdy_p (talk) 20:09, 8 April 2020 (UTC)[reply]

Mismatch in time[edit]

many countries are missing, e.g. palestine, taiwan, Faroe Islands · Gibraltar · Guernsey · Isle of Man · Jersey, greenland.

many are still there, e.g. Byzantine Empire, German Democratic Republic, Ottoman Empire, Russian Empire, Soviet Union, Yugoslavia, Byzantine Empire. (then why czechoslovakia, qing empire, Serbia and Montenegro... dont get a place?)

to see russian empire and ussr appear side by side is... enlightening. -- RZuo (talk) 10:37, 20 July 2021 (UTC)[reply]

Dont float right[edit]

i want to see WDIB, not this template. example: Category:Politics of Germany. RZuo (talk) 18:17, 15 March 2023 (UTC)[reply]

Purpose of „... by topic“ categories[edit]

I don't understand the purpose of the „... by topic“ categories. The way they are added automatically to all categories using this template and the way it completely violates OVERCAT, at first sight it looks more like a maintenance category than like a category actually useful for the reader, but then it should probably be a hidden category and it should be named differently. --Reinhard Müller (talk) 08:16, 4 May 2023 (UTC)[reply]