Template:Translation category: Difference between revisions
Restore trim |
Now will check both the subpage of the last level and the second to last for the language code, thus supports translated tutorials/mods, and inconsistent translated subpage formats. |
||
| Line 1: | Line 1: | ||
<includeonly> | <includeonly>{{#vardefine: $lang-list | {{#dplreplace: | ||
/ ar | |||
# | / ca / cz | ||
/ dk | |||
/ el / eo / et | |||
/ fa / fin | |||
/ ga | |||
/ he / hr | |||
/ id | |||
/ lv / lt | |||
/ moh | |||
/ no | |||
/ pt / ph | |||
/ ro | |||
/ sr / sk / se | |||
/ th / tr | |||
/ ua | |||
/ vi | |||
/ yi | |||
| | / | ||
| | |[\n ]}}<!-- trim whitespace to maintain "switch" feel --> | ||
| | }}{{ | ||
| | #if: {{#pos: {{#var: $lang-list }} | /{{SUBPAGENAME}}/ }} | ||
| | | {{#vardefine: $lang | {{SUBPAGENAME}} }} | ||
| | | {{#if: {{#pos: {{#var: $lang-list }} | /{{SUBPAGENAME:{{BASEPAGENAME}}}}/ }} | ||
| {{#vardefine: $lang | {{SUBPAGENAME:{{BASEPAGENAME}}}} }} | |||
| {{#vardefine: $lang | }} | |||
}} | |||
}}{{ | |||
#if: {{#var: $lang }} | |||
| {{#ifeq: {{{project|}}} | 0 | |||
| | |||
| [[Category:{{#if: trim | {{{1}}} }}/{{#var: $lang }}]] }} | |||
| [[Category:{{#if: trim | {{{1}}} }}]] | |||
}}</includeonly><noinclude> | }}</includeonly><noinclude> | ||
{{documentation}} | {{documentation}} | ||
<!-- Put categories/interwiki on the documentation page --> | <!-- Put categories/interwiki on the documentation page --> | ||