Template talk:Closed captions/layout

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

Template breaking on Wikipedias

[edit]

This template is being used inside Wikipedias (like in pt:File:Great_Feeling.ogv) but when the button is clicked to create subtitles in a new language a page is created in the Wikipedia (like pt:TimedText:Great Feeling.ogv.pt-br.srt) not in Commons, as it would be expected (like TimedText:Great_Feeling.ogv.pt-br.srt). I think the inputbox should have something to prevent it from happening. I tried to solve it but broke the template inside commons itself ;-/ Any sugestions? Crang115 (talk) 19:30, 20 December 2013 (UTC)[reply]

I think that if we replace the lines:
default=TimedText:{{#if: {{{1|}}} | {{{1}}} | {{PAGENAME}}}}.{{int:lang}}.srt preload=TimedText:{{#if: {{{1|}}} | {{{1}}} | {{PAGENAME}}}}.en.srt
to:
{{#ifeq:{{SITENAME}}|Wikimedia Commons|default=|default=:commons:}}TimedText:{{#if: {{{1|}}} | {{{1}}} | {{PAGENAME}}}}.{{int:lang}}.srt {{#ifeq:{{SITENAME}}|Wikimedia Commons|preload=|preload=:commons:}}TimedText:{{#if: {{{1|}}} | {{{1}}} | {{PAGENAME}}}}.en.srt
it should work, but I would like to read another opinions before changing it. User:McZusatz? Crang115 (talk) 20:26, 20 December 2013 (UTC)[reply]

User:Danilo.mac made a cleaner suggestion on IRC:
default={{#ifeq:{{SITENAME}}|Wikimedia Commons||commons:}}TimedText:{{#if: {{{1|}}} | {{{1}}} | {{PAGENAME}}}}.{{int:lang}}.srt preload={{#ifeq:{{SITENAME}}|Wikimedia Commons||commons:}}TimedText:{{#if: {{{1|}}} | {{{1}}} | {{PAGENAME}}}}.en.srt
I guess both solutions should work. Crang115 (talk) 20:48, 20 December 2013 (UTC)[reply]

Did it work for you? For me it did not. Therefore I have reverted the edit. --McZusatz (talk) 00:06, 21 December 2013 (UTC)[reply]
Yes, it didn't work. At least this time it didn't broke on commons. I'm wondering if the special word PAGENAME is being solved inside commons, not in the destination page. I'm tring to do some tests with other special words like FULLURL, but they are not working for me. Crang115 (talk) 00:13, 21 December 2013 (UTC)[reply]
I used :w:commons: and it worked. I know it is not the most elegant way to do it, but since it was an urgent issue (Wikipedias were creating useless pages with this button) I think we should let it like this until a better solution shows up. Crang115 (talk) 00:33, 21 December 2013 (UTC)[reply]
+1. --McZusatz (talk) 00:55, 21 December 2013 (UTC)[reply]