Commons talk:File description page regular expressions

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

Formatting[edit]

Some of these regexes kill whitespaces (e.g. the "|Technique={{Technique|Oil|Canvas}}$1" ones). That can piss off some users when you change stuff like


{{Painting
| name       = ...
| author     = ...
| technique  = Oil on canvas
| permission = ...
...
}}

to


{{Painting
| name       = ...
| author     = ...
|Technique={{Technique|Oil|Canvas}}
| permission = ...
...
}}

I'd suggest to use whitespace-preserving (and parameter capitalization-preserving) regexes. --Slomox (talk) 17:40, 2 September 2010 (UTC)[reply]

I was planing to do those the same way I did the others but forgot. They're fixed now. Rocket000 (talk) 19:13, 2 September 2010 (UTC)[reply]

Unknown dates[edit]

One of the entries is

(\|[ ]*(?:date|author)[ ]*=[ ]*)(?:unknown|\?+)\.?[ ]*(\||\}\}|\r|\n)     >>>     $1{{unknown}}$2

For dates I'd suggest to use {{Other date|?}} instead. There's no big difference in the result, but it gives more semantic context. I don't know any actual example where this is relevant, but in languages with complex grammar rules it could be the case that the word corresponding to 'unknown' must use different endings when applied to immaterial object like a date than when applied to a human being like an author. --Slomox (talk) 17:50, 2 September 2010 (UTC)[reply]

Ok, done. I am just starting to look into {{Other date}} and replacements we can do with it. Rocket000 (talk) 19:13, 2 September 2010 (UTC)[reply]
What about Location=unknown? Can that be added to the author one? Rocket000 (talk) 19:37, 2 September 2010 (UTC)[reply]
I don't know. It's okay for all languages _I_ know, but that's only 0.05% of the total number of languages that exist ;-) If we want to be on the safe side, we should create something with semantical context like {{UnknownAuthor}} and {{UnknownLocation}}. --Slomox (talk) 21:53, 2 September 2010 (UTC)[reply]
How about extending {{Unknown}} so it can be used like {{unknown|author}}, {{unknown|location}}, etc.? Rocket000 (talk) 23:34, 2 September 2010 (UTC)[reply]
Sounds good. --Slomox (talk) 02:08, 3 September 2010 (UTC)[reply]
What I'll do is simply start adding the parameter whenever I use it but not change the template at this time. As far as English and probably most other languages go there's no difference, so we don't really need to add a #switch:{{{1}}} until (and if) we need it. Rocket000 (talk) 02:33, 3 September 2010 (UTC)[reply]
I think it is not a good idea to add an parameter to a template, if the template does not support the parameter at the moment. That can lead to a lot of trubble if people forget about this discussion. --Schlurcher (talk) 09:31, 4 September 2010 (UTC)[reply]
It has no effect whatsoever. Why would it be a problem? Rocket000 (talk) 16:34, 4 September 2010 (UTC)[reply]

Some other things we can do[edit]

  1. Dimensions of paintings, i.e. "123 х 190 cm"
  2. Dates with " (original upload date)" after it
  3. Place names that have multilingual tags
  4. More types of techniques
  5. Names of Wikimedia projects ({{Language}} and I think there's one for projects but can't find it now {{Projectname}})
  6. Transferr?ed from... (similar to last one)
  7. Linked dates, included years only
  8. Dates with names of months
  9. The original uploader was...
  10. Convert unnecessary redirected templates, (like {{Self2}} -> {{Self}})

Feel free to edit/add to the above list if you got ideas. Rocket000 (talk) 19:32, 2 September 2010 (UTC)[reply]

and I think there's one for projects but can't find it now: {{Projectname}}? --Slomox (talk) 21:56, 2 September 2010 (UTC)[reply]
That's it. Thanks. Rocket000 (talk) 23:30, 2 September 2010 (UTC)[reply]

added expressions to list[edit]

  • I have added some expressions in order to find:
  • "|author=Not given" for example some 1250 found with:
incategory:"Images from USC Digital Library uploaded by Fæ" insource:"author=Not given"
  • I can't find any list for adding {{other date|unknown}} into the date field

I presume capital / non-capital letters don't matter in this list. Can somebody please check my edit. @Steinsplitter: for example. Thanks. --Zaccarias (talk) 19:16, 10 September 2017 (UTC)[reply]

Looks good. --Schlurcher (talk) 17:39, 2 January 2018 (UTC)[reply]