Template talk:Translation categories

Latest comment: 7 years ago by Matěj Suchánek in topic Small update

Using for translated templates edit

{{Edit request}} For using in "Template:" namespace need fixed second category name calculation. Proposed code:

<includeonly><onlyinclude>[[Category:{{{category|{{#titleparts:{{FULLPAGENAME}}|1}}}}}|{{basepage subpage|en|{{SUBPAGENAME}}}}]]
[[Category:{{{nscategory|{{#ifeq:{{NAMESPACE}}|Template|Templates|{{NAMESPACE}}}}}}}-{{basepage subpage|en|{{SUBPAGENAME}}}}]]</onlyinclude></includeonly>

{{documentation}}
Should this replace the whole code of the template?--Ymblanter (talk) 03:33, 1 March 2013 (UTC)Reply
Yes, for the simplicity. Only second string was changed. --Kaganer (talk) 09:13, 1 March 2013 (UTC)Reply
See example in the Template:User_groups. After changes, unexists category "Template-en" should be replaced by exists category "Templates-en". --Kaganer (talk) 09:15, 1 March 2013 (UTC)Reply
  Done, pls let me know if smth does not work and needs to be changed again.--Ymblanter (talk) 11:44, 1 March 2013 (UTC)Reply
Look good ;) Thanks! --Kaganer (talk) 15:45, 1 March 2013 (UTC)Reply

Using for translatable subpages edit

This template did not works at the translatable subpages. See example: Wikidata:Notability/Exclusion criteria.

Please change code:

-{{basepage subpage|en|{{SUBPAGENAME}}}}

to

-{{#ifexist:{{FULLPAGENAME}}/en
  |{{#ifeq:{{#titleparts:{{PAGENAME}}|1}}|{{#titleparts:{{PAGENAME}}|2}}
     |{{basepage subpage|en|{{SUBPAGENAME}}}}
     |{{basepage subpage|en|en|{{SUBPAGENAME}}}}
   }}
  |{{basepage subpage|en|{{SUBPAGENAME}}}}
}}

Thanks. --Kaganer (talk) 11:30, 5 April 2013 (UTC)Reply

What page should be changed?--Ymblanter (talk) 12:57, 5 April 2013 (UTC)Reply
This template, string 2, end of link. Full template's text:
<includeonly>[[Category:{{{category|{{#titleparts:{{FULLPAGENAME}}|1}}}}}|{{basepage subpage|en|{{SUBPAGENAME}}}}]]
[[Category:{{{nscategory|{{#ifeq:{{NAMESPACE}}|Template|Templates|{{NAMESPACE}}}}}}}-{{#ifexist:{{FULLPAGENAME}}/en
  |{{#ifeq:{{#titleparts:{{PAGENAME}}|1}}|{{#titleparts:{{PAGENAME}}|2}}
     |{{basepage subpage|en|{{SUBPAGENAME}}}}
     |{{basepage subpage|en|en|{{SUBPAGENAME}}}} }}
  |{{basepage subpage|en|{{SUBPAGENAME}}}} }}]]</includeonly><noinclude>

{{documentation}}
</noinclude>
--Kaganer (talk) 20:23, 5 April 2013 (UTC)Reply
  Done, pls report any problems here.--Ymblanter (talk) 20:28, 5 April 2013 (UTC)Reply

Another refactoring edit

{{Edit request}} This template is too complicated and is not worked correctly in the subsubpages (second level) - see Wikidata:Roads task force/Germany/Bundesautobahn. Using {{Basepage subpage}} for second category name is irrationally.

Proposed template text:

<includeonly>[[Category:{{{category|{{#titleparts:{{FULLPAGENAME}}|1}}}}}|{{basepage subpage|en|{{SUBPAGENAME}}}}]]
[[Category:{{{nscategory|{{#ifeq:{{NAMESPACE}}|Template|Templates|{{NAMESPACE}}}}}}}-{{#ifeq:{{lc:{{#titleparts:{{FULLPAGENAME}}|1|-1}}}}|{{#language:{{#titleparts:{{FULLPAGENAME}}|1|-1}}}}
    |en
    |{{lc:{{#titleparts:{{FULLPAGENAME}}|1|-1}}}} }}]]</includeonly><noinclude>

{{documentation}}
</noinclude>

--Kaganer (talk) 22:05, 31 May 2013 (UTC)Reply

  Done The Anonymouse (talk) 16:30, 6 June 2013 (UTC)Reply

Small update edit

{{Edit request}}

Using "lc:" edit

Two arguments #ifeq: may be not equal in some variants of "base pages".

As example, for Wikidata:Meta-Wiki:

  1. code {{lc:{{#titleparts:{{FULLPAGENAME}}|1|-1}}}}
    returned value wikidata:meta-wiki
  2. code {{#language:{{#titleparts:{{FULLPAGENAME}}|1|-1}}}}
    returned value wikidata:meta-Wiki

Please change code

  • {{#language:{{#titleparts:{{FULLPAGENAME}}|1|-1}}}}

to code

  • {{lc:{{#language:{{#titleparts:{{FULLPAGENAME}}|1|-1}}}}}}

--Kaganer (talk) 11:55, 24 November 2016 (UTC)Reply

Sort order for subpages with subsubpages edit

In some cases like Category:Wikidata:Tools, including some page, his translations and also its subpages with their translations, sort order needs be improved. In my opinion, should not be used {{Basepage subpage}} in this template.

I propose code {{basepage subpage|*|{{SUBPAGENAME}}}} change to:

{{#ifeq:{{lc:{{#titleparts:{{FULLPAGENAME}}|1|-1}}}}|{{lc:{{#language:{{#titleparts:{{FULLPAGENAME}}|1|-1}}}}}}
    |*
    |{{lc:{{#titleparts:{{FULLPAGENAME}}|1|-1}}}} }}

--Kaganer (talk) 12:30, 24 November 2016 (UTC)Reply

Full code proposed edit

Full proposed template's text:

<includeonly>[[Category:{{{category|{{#titleparts:{{FULLPAGENAME}}|1}}}}}|{{#ifeq:{{lc:{{#titleparts:{{FULLPAGENAME}}|1|-1}}}}|{{lc:{{#language:{{#titleparts:{{FULLPAGENAME}}|1|-1}}}}}}
    |*
    |{{lc:{{#titleparts:{{FULLPAGENAME}}|1|-1}}}} }}]]
[[Category:{{{nscategory|{{#ifeq:{{NAMESPACE}}|Template|Templates|{{NAMESPACE}}}}}}}-{{#ifeq:{{lc:{{#titleparts:{{FULLPAGENAME}}|1|-1}}}}|{{lc:{{#language:{{#titleparts:{{FULLPAGENAME}}|1|-1}}}}}}
    |en
    |{{lc:{{#titleparts:{{FULLPAGENAME}}|1|-1}}}} }}]]</includeonly><noinclude>

{{documentation}}
</noinclude>

--Kaganer (talk) 00:32, 28 November 2016 (UTC)Reply

  Done Matěj Suchánek (talk) 12:16, 18 March 2017 (UTC)Reply
Return to "Translation categories" page.