How to use the template svitek

Z thewoodcraft.org
Toto je přeložená verze stránky Použití šablony svitek, překlad je hotový z 100 %.
Jiné jazyky:

The template {{svitek}} is used for inserting strings into pages within coups and degrees of this electronic version of the Roll. The template {{kategorie}} works in a similar way.

The template parameter is the string from which the name of the page in translation is generated, and if there is a translation into the currently selected interface language, it inserts the translated text into the place where it is used. This string always begins with a code followed by a dash and the number of the message being translated. It can be any string. Not only the code of the specific coup 1A1, the coup group 1A, or the coded degree name.

By means of this template, more general texts used within the roll and repeated in various places may be inserted. For example, the code „{{svitek|timesec}}” will be replaced with text: „Čas je uveden v sekundách.”

PoznámkaIf you see the original string on yellow background instead of the translated text, it means that the message has not been translated into the target language yet. The same is displayed also when default language of the page is set if the called-out page exists but the content has not been marked for translation yet. Only members of the group translator have the right to perform this operation.

The page which the template {{svitek}} searches always begins with the prefix svitek- followed by a parameter conveyed to the template. It is a standard page, and the translated message de facto searched for by the template is a subpage named as the code of the currently used interface language, the translated TU (translation unit). So, if we use the code:

{{svitek|1A1-1}}

The template inserts the appropriate subpage with the translation of the page svitek-1A1-1 - only if it exists though. If the interface is in Czech, use page svitek-1A1-1/cs, for Polish use svitek-1A1-1/pl, etc.

Upozornění The template {{svitek}} is locked because the template {{kategorie}} works with it, generating printing outputs and input data for the template {{TBC}}.

Moreover, make sure that in pages called out via the template {{svitek}}, the element <noinclude>…</noinclude> is applied correctly, so that the code used does not get interpreted incorrectly.

Upozornění If you do not apply this to the element <noinclude><languages /></noinclude>, using this template on another translated page with text content might cause the language bar to be inserted too!
PoznámkaIf you used the template {{svitek}} also for a page with code name beginning with the prefix svitek-, processing the template would create a loop. And, instead of the translated text or a an request for translation, only an error notification would be displayed. This is why the template {{skok}}, a copy of the template {{svitek}}, is used on this website .


Na ilustračním obrázku můžete vidět, jak taková chyba vypadá.

Abychom zjistili, odkud se bere, musíme se podívat do kódu.

Vzhledem k tomu, že, se v tomto případě se šablona {{svitek}} volá pouze jednou, je jasné kde je potřeba chybu hledat. Vyskytovala se na stránce svitek-con0, ale jak sami vidíte, vše se na první pohled jevilo v pořádku. Takže kód šablony {{svitek}} byl interpretován správně. Ale jak můžete vidět i na screenshotech, byla to stránka s prefixem svitek-.

Stačilo tedy zaměnit jméno šablony {{svitek}} za {{skok}} a problém byl vyřešen.