Template talk:Category description/Year by administrative division

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

New approach for categories by year[edit]

Currently, the usual procedure when splitting a category into subcategories per year is to create an individual template just for that single branch, from {{Namibiayear}} over {{CZChurchArc}} to {{Blood donation in Main-Tauber-Kreis year}}. As the time of writing, we have 15,794 (!) individual templates like this, counting only those which are based on {{Decade years navbox}}, and in the last weeks we created around 10 new such templates per day.

With the {{Category description}} framework, we now have a possibility to create templates which are way more flexible and can be used for literally dozens or hundreds of similar category branches, reducing the need for new templates by magnitudes. For example, for this template here, we just need a few variants – {{Category description/Year by state}} already exists, but we can of course create {{Category description/Year by district}}, {{Category description/Year by province}}, {{Category description/Year by oblast}}, {{Category description/Year by autonomous community}} and so on – to cover for everything from {{Aachenyear}} to {{Zwolleyear}}.

Please have a look at the categories 2024 in Vorarlberg and Vorarlberg in the 2020s where I already inserted the new template as a proof of concept. You might notice that this template framework has some nice advantages over the traditional method:

  • Tidy: Everything is embedded in a single {{Navbox}} instead of an accumulation of several boxes, all formatted and aligned differently.
  • Descriptive: Each of the {{Category description}} subtemplates can optionally contain a description text which will be shown on all categories, to better define the scope of the category. This text is then maintained centrally, it's translateable, and of course it shows on all the categories.
  • Translated: The labels for the heading and the navigation bars are taken from Wikidata, meaning that they are always displayed in the user's preferred language, without any need to do any translation here on Commons. Only the description text have to be written and translated once per subtemplate.
  • Easy to use: All you have to put on the category page is, for example, {{Category description|Year by state}}. The underlying module will analyze the category name and display the correct navigation bars fully automatically. No need to add the decade or the year as a parameter. Dozens or hundreds of categories can be created by simply copying the exact same line into the category page.
  • Universal: As already written above, a single subtemplate can potentially replace many hand-written templates.

The caveat of the whole {{Category description}} framework is that it heavily relies on Wikidata. Wrong information in Wikidata (for example located in the administrative territorial entity (P131) not containing the correct upper-level administrative entity) will lead to wrong or missing navigation bars or even to error messages. But such Wikidata bugs have to be fixed only once (which should be a good idea anyway) and all these templates will work correctly from then on. And if you don't want to deal with Wikidata at all, there will be a number of volunteers (like me) who will help fix these issues.

Of course I'm not proposing that we now immediately replace all the 15,000 existing templates. But if we find some rough consensus about the usage of this new approach, we could at least stop creating hundreds of new templates per month, and maybe, when the occasion arises, replace some selected old templates to achieve consistency within a category branch.

@Fantaglobe11, Birdie, AgainErick, Labintatlo, Der Bauernseufzer, Clay, ValeriySh, AnRo0002, Enyavar, Roc0ast3r, Ludger1961, and Triplec85: You all seem to be very active in maintaining all these categories by year, so I'm explicitly pinging you here and I'm looking forward to comments from you and of course everybody else as well! Thanks -- Reinhard Müller (talk) 09:56, 16 March 2024 (UTC)[reply]

Supporting this. I can tell you put a lot of time and effort in this, so I applaud you for that. My only semi-critique with this is that the template looks a little plain. Its ultimately not a huge deal, but I wonder if an image (such as the flag or coat of arms of the region, icon of the topic, or both) would help?  RONIN  TALK  10:47, 16 March 2024 (UTC)[reply]
Hello, @Reinhard Müller! Thanks for pinging me here. I generally appreciate your commitment and attempt of reducing individual templates. Probably, this would make things way easier, if information on Wikidata was well and uniformly maintained, of course. I've already added your template {{Category description}} experimentally for categories like 2024 in North Rhine-Westphalia, 2024 in Zwolle and 2024 in Drenthe. The result for the first two ones was really satisfying, but I've got some problems with 2024 in Drenthe. Obviously, the provinces are hierarchical the same like the BES islands on Wikidata, what seems wrong as I find. Additionally, the template didn't work out for 2024 in Rijssen, the year category of the place Rijssen that belongs to the municipality of Rijssen-Holten. Is it possible for you to find it, if this is a problem of the Wikidata information?
The main problem I see is that every single country is different and we have endless exceptions, that will make it really to harmonize all those individual templates. But I'm also looking to other ideas and opinions.
Best regards, Fantaglobe11 (talk) 10:57, 16 March 2024 (UTC)[reply]
thx a lot for the hard work.
yes many of these similar templates should be conbined. i think i didnt create new templates exactly because of this. i normally just used the basic {{Minx}}.
as for exceptions, my opinion is that the best approach is leave those categories outside of the templates? and add them to the category pages as usual wikitext. cramping exceptions for every single division in every single country into 1 template is not a good design, i think. RZuo (talk) 12:05, 16 March 2024 (UTC)[reply]

Thank you for the quick, positive and motivating feedback!

Please let me stress once again that we must use the correct template variant out of the (so far imcomplete) list of {{Category description/Year by state}}, {{Category description/Year by district}}, {{Category description/Year by province}}, {{Category description/Year by oblast}}, etc. For example, if we use {{Category description/Year by state}} on 2024 in Drenthe, it will try to add the category 2024 in the Netherlands by state, but the correct category is of course 2024 in the Netherlands by province, so we must use {{Category description/Year by province}} (which I still have to create).

  • @Roc0ast3r: Regarding image: you can tell that I'm more of a programmer than a designer ;-) I didn't add any image because I found that they don't contribute any information, but I'm open to ideas. The good thing about this framework, again, is that we can add images later at a very central point and don't have to update hundreds of templates.
  • @Fantaglobe11: Thank you for testing! From what I understand, it is technically correct that the BES islands are on the same level of the administrative hierarchy than the provinces, since they are all directly under The Netherlands. But I also understand and agree that they are not exactly the same thing and should be separated. So let's dive deep in the magic possible with the new framework: I only had to create {{Navigation by/administrative division/Q55}} ("Q55" for Netherlands (Q55)) to declare how the 15 entities should be devided into a group of 12 and one of 3. Now try again with 2024 in Drenthe.
  • On the other hand, Rijssen is not an administrative entity and thus it's outside the scope of the currently available templates, which work only for administrative entities, but not for sub-municipality villages, valleys, or other places.
  • @Fantaglobe11 and RZuo: As for the exceptions, I think some of them can be handled with reasonable effort; for example the Q55 magic described above for the European and the Carribean parts of the Netherlands had to be done once and can now show its power in hundreds of categories (we have not only the year templates, but we also have flora, taxons, seasons...). And for the really awkward exceptions, I totally agree with RZuo that if we cover 95% of the categories, we already have a huge step forward :-)

That's from me so far, looking forward to further comments! --Reinhard Müller (talk) 15:04, 16 March 2024 (UTC)[reply]

@Reinhard Müller: Thank you very much for the effort to achieve standardization. Regarding to the first answer from User:Roc0ast3r: I think it's nice when templates can have individual images (e.g. flag to country/state/district/municipality + topic (e.g. agriculture images for agricultural templates by year, transport images for transport templates by year, or the example in the first line to Blood donation by year with images for blood donation).
By now, almost all people have smartphones with good cameras. So the number of images in commons is increasing faster and faster. If image categories are well filled in the future, we will get more and more categories by year, and we will also need them in order to keep a meaningful overview of the millions of images. That's where standardization makes sense.
Greets -- Triple C 85 | User talk | 17:31, 16 March 2024 (UTC)[reply]
Thank you for your fast refinement! I've already made a new proof for 2024 in Drenthe, that really looks more appealing to me. The classification by {{Navigation by/administrative division/Q55}} is well done – thanks!
I also understand the difficulty that Rijssen isn't an administrative entity. However, the Netherlands lots of those "non-administrative entities" which are former municipalities. For this reason, we still have many of those "old" municipality categories by year. Maybe, I have to rethink about another solution.
I agree with Roc0ast3r and Triplec85 that an individual image to those templates would be a fine addition. I don't think it's really necessary, but still nice-to-have.
That's all so far. Kind regards, Fantaglobe11 (talk) 11:48, 17 March 2024 (UTC)[reply]

Okay, we now have Year by country, region, province, district, municipality, and settlement (for entities like Rijssen). That should cover the basic structure of many countries, if you need anything more, just let me know (of create it yourself, when you look at the existing templates it's quite straightforward). I can also create other templates, whatever you need, churches by district and decade, events by province and century, rail transport bridges by municipality and year of destruction, ... just let me know what you want to work on.

Regarding images, I must spend a few more brain cells about a good solution. Stay tuned.

Thanks --Reinhard Müller (talk) 20:23, 17 March 2024 (UTC)[reply]

Hi, I feel honored to have been mentioned for being "very active in maintaining all these categories by year". I only ever created a few templates for "elections in country by year" and for "MapsRegionDecade" (like MapsCentralAsiaDecade), which was wholly based on existing templates that I just duplicated. Does that already make me "very active"?
On another note, I am still highly supportive of correcting the fundamental flaw of Category:Austria in the 2020s vs. Category:2020 in Austria and would support Category:2020s in Austria (to go with the by-year cat) over Category:Austria in 2020 (to go with the by-decade cat). I could live with either fix. As far as I understand your work, you don't wish to do so, but to entrench the current state of affairs via the template coding? Has there ever been a compelling argument in favor of switching around the category naming-styles in that way? Just asking that question, I know it has little to do with your excellent template-work. --Enyavar (talk) 22:09, 17 March 2024 (UTC)[reply]
Hallo Reinhard, thank you for putting me in the "very active contributors". France and several african countries use "departments" and Japan uses "prefectures", copying the template wasn't too complicated. Have a nice day. Birdie (talk) 08:07, 18 March 2024 (UTC)[reply]

Testing 202403[edit]

Category:2024 in Wittenberg, is what i did correct? RZuo (talk) 13:45, 24 March 2024 (UTC)[reply]

Yes, absolutely! contains the administrative territorial entity (P150) was missing for Wittenberg (Q6075) in Wikidata, now as I fixed that, the navigation by the various municipalities in "Landkreis Wittenberg" is also there.
You might want to switch the existing categories for the other years as well for consistency within Wittenberg, and {{Wittenbergyear}} will not be needed any more.
You can also fill the gap in the administrative levels by creating the missing categories for "Landkreis Wittenberg by year" very easily now, without creating a new template and by just using {{Category description|Year by district}} 1:1 on any of the year categories.
If there's any further question, please don't hesitate to ask! --Reinhard Müller (talk) 17:39, 24 March 2024 (UTC)[reply]
why is Category:2024 in Wittenberg sorted by @ in Category:Wittenberg by year? RZuo (talk) 19:59, 24 March 2024 (UTC)[reply]
There are different sort keys used for years, many (for example Category:Bamberg by year) use a space, which I think should be reserved for "x by y" metacategories. I chose the @ because it leaves all the special prefixes like !, *, $ etc. for top-sorted special cases. On my user page I have collected a few thoughts about sort prefixes. --Reinhard Müller (talk) 08:00, 25 March 2024 (UTC)[reply]
personally, i either dont use prefix, so they are sorted by the numbers, which is easy for years (under 1 or 2, and pad pre-1000 years with 0 so they go under 0); or i use #, because the hash sign often is interpreted as "number". still, pre-1000 years have to be padded with 0. and then BC years are tricky to deal with. RZuo (talk) 08:53, 25 March 2024 (UTC)[reply]
I considered # as well, but that has the disatvantage that in the sort order it comes before *, + and other often used special characters, which means that numerically sorted items would come before * and alphabetically sorted items after. @ has the advantage that it's in the sort order exactly at the same spot where the alphabetically sorted items (A-Z) are. --Reinhard Müller (talk) 11:45, 25 March 2024 (UTC)[reply]
great summary of sortkey practices. i wanted to do a similar summary too. RZuo (talk) 08:59, 25 March 2024 (UTC)[reply]
another problem: for example, in china, the administrative levels are: province > (prefecture-level) city (=european municipality?) > county/district..., so the order is the other way around, compared to german kreis > stadt. how does the template deal with this? RZuo (talk) 20:12, 24 March 2024 (UTC)[reply]
That is not a problem The terms like "municipality", "province", "district" etc. don't say anything about the hierarchy, they are only there to decide on whether to look for category names "... by municipality", "... by province", etc. --Reinhard Müller (talk) 08:00, 25 March 2024 (UTC)[reply]
@Reinhard Müller in some countries they use "city". should i create subtemplate Year by city for them, or can just use Year by municipality? RZuo (talk) 14:11, 16 April 2024 (UTC)[reply]
@RZuo: Tough question. I know that for example in Austria, for a long time "by city" was used, but it is incorrect because only a few of the Austrian municipalities are cities, so more and more category tree branches are switched to "by municipality" which is the correct term. But of course I don't know what the correct term is in all countries across the world. If the correct term really is "city", then yes, please create a subtemlate "Year by city" (and "City by decade" and "City by century") for these cases. It should be easy with copying from the municipality templates. --Reinhard Müller (talk) 14:59, 16 April 2024 (UTC)[reply]
tested again https://commons.wikimedia.org/w/index.php?diff=prev&oldid=867759837 . is this correct? :) RZuo (talk) 17:06, 12 April 2024 (UTC)[reply]
The "pagename" parameter is only needed to demonstrate the template somewhere else than where it actually belongs, for example on a documentation page. In normal use, you never need to use this parameter. Other than that, it was correct :-) --Reinhard Müller (talk) 20:39, 12 April 2024 (UTC)[reply]
looking at Category:2025 in Turkey. maybe the template should also automatically add the cats "yyyy in Continent" and "yyyy by country". RZuo (talk) 06:52, 13 April 2024 (UTC)[reply]
I have added "yyyy by country". I disagree with "yyyy in Continent", and Turkey is a good example why: it spreads across two continents, so in general I don't think countries should be sorted into continents. --Reinhard Müller (talk) 07:57, 15 April 2024 (UTC)[reply]
but what's the purpose of Category:2024 in Asia if it doesnt contain all the "2024 in country"? RZuo (talk) 11:38, 15 April 2024 (UTC)[reply]
IMHO the Category:2024 in Asia should only contain subcategories for areas which are completely in Asia. So not "2024 in Turkey", because that would put a lot of files into "2024 in Asia" which are outside of Asia, but rather only categories about the Asian part of Turkey. This cannot (easily) be done automatically by the template, so such categories must be added manually. --Reinhard Müller (talk) 07:14, 16 April 2024 (UTC)[reply]
i tried using Year by administrative division, Year by district, for Category:2024 in Landkreis Potsdam-Mittelmark, but the previews all appear blank. RZuo (talk) 21:29, 15 April 2024 (UTC)[reply]
I just created the category with "Year by district" and it immediately worked for me. Maybe you had a typo? --Reinhard Müller (talk) 07:14, 16 April 2024 (UTC)[reply]
i just realised why. i wrote ...description/Year... instead of ...description|Year... because i copy pasted the title of the template page. RZuo (talk) 13:00, 16 April 2024 (UTC)[reply]
maybe we need "Template:Category description/Administrative division by year" to make "city by year" for Category:Zhongshan by year? RZuo (talk) 17:04, 16 April 2024 (UTC)[reply]